-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Enforce new line for each array item if there's already at least one new line #6675
Comments
And I'm 👍 to add a rule that enforces newlines around every entry of an array as soon as there is at least one newline. |
@VincentLanglet @julienfalque this ☝🏼 and maybe this then? |
The PR will fix the bug indeed. Then we could add a rule to improve the display of multiline array (one item by line). |
This comment was marked as outdated.
This comment was marked as outdated.
The rule is still not implemented |
@VincentLanglet isn't it the same feature request as in #1217? |
I would say yes and no. The referenced issues ask to always split multi items array. Mine ask to fully split multi items arrays IF you started to write it multi line. |
The new rule should be a part of @PER-CS ruleset as stated in https://www.php-fig.org/per/coding-style/
|
@winiarekk it's only |
It MAY be split across multiple lines, That's exactly the feature request. I want
to be untouched, but
fixed to
|
You're both right, I wasn't focused enough. Tough time in private life, that's why I don't do much here recently 😥. Good to see fresh heads around 👍. |
This comment was marked as outdated.
This comment was marked as outdated.
Still relevant. |
ℹ️ Note: related to #1217, but it looks like it should be implemented as configurable strategy.
Rule request
I just encountered the issue when I was surprised that
was fixed to
by the trailing_comma_in_multiline rule.
Any idea about the name ?
trailing_comma_in_multiline
have a special behavior when the]
is on the same line than the last element ? I would expectto be untouched by this rule.
WDYT ?
The text was updated successfully, but these errors were encountered: