-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more coding standard rules #4474
Conversation
IIRC, there was a discussion on the Symfony repo reporting that Twig coding standards don't define the spacing rule around the |
For the record, currently Twig-CS-Fixer consider it should be
and
|
e8f1779
to
c96aefd
Compare
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll work on implementing the missing rule in Twig-CS-Fixer :)
|
||
* Use snake case for all function/filter/test names: | ||
* Put exactly one space after the ``:`` sign in macro argument declarations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabpot It works too for named arguments
{{ html_input(class_name: 'pwd') }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I just noticed, but I don't think this macro definition is a valid one.
{% macro html_input(class: "input") %}
@@ -88,21 +88,34 @@ standards: | |||
[1, 2, 3] | |||
{'name': 'Fabien'} | |||
|
|||
* Use snake case for all variable names (provided by the application and | |||
created in templates): | |||
* Do not put any spaces before and after ``=`` in macro argument declarations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works too for named arguments
{{ html_input(class_name='pwd') }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong for macro, seems like it should be =
cf https://twig.symfony.com/doc/3.x/tags/macro.html
I opened #4488 |
No description provided.