You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
twigcs currently detects default values in macro definitions as named arguments, and request you use no space around the =. I'm not sure if this is a decision based on the lack of clear standard, or simply a bug.
If this is a bug or an oversight, I'd be happy to look into it and try to work on a quick PR to fix this. I'd just like to validate the desired standard here before getting started.
Run twigcs (vendor/friendsoftwig/twigcs/bin/twigcs templates)
Expected Result
No violation found.
Actual Result
l.1 c.31 : ERROR There should be 0 space before the "=" in the named arguments list.
l.1 c.33 : ERROR There should be 0 space after the "=" in the named arguments list.
The text was updated successfully, but these errors were encountered:
Hello and thank you for reporting this. I think it's a duplicate of #170
I tried to look at the fix a few weeks ago and it's not that easy. We would need some improvement on the code that split parenthesis to make the difference between a macro declaration and other parenthesis (macro call, arithmetic expression, etc...).
Hey folks!
Looking at the Twig Coding Standards, there doesn't seem to be a set standard for defining default values in macros.
However, the official documentation for macros uses spaces around the
=
in its examples.twigcs currently detects default values in macro definitions as named arguments, and request you use no space around the
=
. I'm not sure if this is a decision based on the lack of clear standard, or simply a bug.If this is a bug or an oversight, I'd be happy to look into it and try to work on a quick PR to fix this. I'd just like to validate the desired standard here before getting started.
Steps required to reproduce the problem
vendor/friendsoftwig/twigcs/bin/twigcs templates
)Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: