Hey folks π
I'd like to introduce you to a tool I've developed called "Nos Twig Code Sniffer." This tool aims to identify invalid Twig templates and uphold the official Twig coding standards with a few exceptions in to your PYZ/Yves Codebase.
If you find this project to be useful or encounter any issues, please don't hesitate to reach out to me, create an issue or submit a pull request. π
We use in our project this twig lint (
) but of course your code sniffer seems to be suitable for spryker customizations (define, widget.. etc..).Good idea!
@Guido X Jansen can u maybe put this in the community repos, even if @andreas.penz is agree with it?
@ynnoig initially i wanted to use the "twigcs" lib also until I encountered this issue:
@Guido X Jansen i would agree to add this to the community repositories
Hey,
this seems like a nice tool-addition :)
I have a suggestion: use every Namespace-Entry from $config[KernelConstants::PROJECT_NAMESPACES]
inside of TwigCodeSnifferConfig
, when return the paths ;)
This way, every project won't need to overwrite the config just for their namespace
Props to you! Looks extremely promising!
Goooo @andreas.penz !! ππ€©
@sven.ommer perhaps it would be more optimal to configure the paths in config/Shared/config_xyz.php and substitute the Pyz segment with an asterisk (*) to automatically scan all Yves templates within the src folder by default.What do you think about that?
I also just found out that "GLOB_BRACE" ("{a,b,c}") inside the path is not support by on all plattforms - i will also implement support for this stuff in the next release.
Would you be so kind as to create your feature request as an issue on GitHub? π
@andreas.penz awesome! And done @ynnoig:
I wouldn't do the "scan all", because sometimes you don't want other stuff to check, but the config is a good solution :)
@sven.ommer Thanks for your feature request. The tool now uses all configured project namespaces in order to generate the appropriate theme paths. These changes are already part of the newest release ->Β