Nos Twig Code Sniffer
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. π
Comments
-
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?
2 -
@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
5 -
Hey,
this seems like a nice tool-addition :)
I have a suggestion: use every Namespace-Entry from
$config[KernelConstants::PROJECT_NAMESPACES]
inside ofTwigCodeSnifferConfig
, when return the paths ;)
This way, every project won't need to overwrite the config just for their namespace1 -
Props to you! Looks extremely promising!
1 -
Goooo @andreas.penz !! ππ€©
1 -
@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? π
0 -
Guido X Jansen Global Business & Technology Evangelist Sprykee Posts: 425 βοΈ - Guardians (admin)
@andreas.penz awesome! And done @ynnoig:
1 -
I wouldn't do the "scan all", because sometimes you don't want other stuff to check, but the config is a good solution :)
1 -
@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 ->Β
1
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 75 Spryker News
- 919 Developer Corner
- 779 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random