Twig linting for tests/CI (similar to PHPStan and ECS) #16523
Unanswered
jamesmacwhite
asked this question in
Ideas
Replies: 1 comment
-
It would appear at least one unofficial Craft CMS Twig ruleset exists for twigcs: https://github.com/acalvino4/craft-twigruleset |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On a project I made a fairly large update to many core Twig templates which are extended or inherited across various templates. It raised the question around some form of Twig lint/testing tool to be able to identify issues such as syntax errors after the refactor. Because the change modified many files it was hard to defend against regressions.
It would be good if there was a way to do Twig lint checks for ad-hoc or CI purposes Symphony has https://symfony.com/doc/7.3/templates.html#linting-twig-templates
There appears to be other tools: https://github.com/friendsoftwig/twigcs
It would be nice if Craft CMS potentially either provided something similar or shipped a ruleset that can work with an existing tool.
Beta Was this translation helpful? Give feedback.
All reactions