-
Notifications
You must be signed in to change notification settings - Fork 33
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
Allow new lines after opening blocks #58
Comments
Hello, As of https://twig.symfony.com/doc/2.x/coding_standards.html it is stated :
My understanding of this is that you should format like this : {% set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
] %} But you can still use custom rules with Twigcs. |
That's how we work around right now. But this kind of formatting does not look well. |
I personally got quite used to it, it saves 2 lines in vertical space. But that's pure opinion without any facts. Twigcs is not about forcing you to do this. The tool is meant to allow you to enforce the rules you want in your project. In your case you should go with a custom Ruleset so you can set up the coding style that suits you. |
Yes, but the rule (DelimiterSpacing) has no configuration options to change that behavior. So besides the Ruleset we will have to develop a new Rule for that. |
We can add this. I have very little available time at the moment for open source projects. If you want to help you can add this or I will do it but that will take some time. |
I am not quite familiar with Twig lexer. So I think it ls better to leave this for you. |
Drupal core use multiline block statements to set Twig variables like follows.
https://github.com/drupal/drupal/blob/8.6.10/core/themes/classy/templates/block/block.html.twig#L28
Twig coding standard does not forbid this syntax. So I think Twigcs should no complain about that.
Currently it brings
ERROR There should be 1 space(s) after opening a block.
violation.Thanks.
The text was updated successfully, but these errors were encountered: