Skip to content
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

bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element #6677

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

kubawerlos
Copy link
Contributor

Fixes #6675

Copy link
Member

@julienfalque julienfalque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but since we actually had test cases for adding the comma, should we consider this a BC break and introduce a new option?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3388318456

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 92.917%

Files with Coverage Reduction New Missed Lines %
src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php 1 94.94%
Totals Coverage Status
Change from base Build 3365138575: -0.004%
Covered Lines: 17276
Relevant Lines: 18593

💛 - Coveralls

@VincentLanglet
Copy link
Contributor

VincentLanglet commented Nov 3, 2022

Looks good to me but since we actually had test cases for adding the comma, should we consider this a BC break and introduce a new option?

It was introduced in #4238 without anybody talking about this special test cases. So technically we can consider this as a BC break but I really feel like it's more an improvement. Having a special option for this seems too much. I don't expect any complaint "I want the code like it was before"

@julienfalque julienfalque merged commit bb94db0 into PHP-CS-Fixer:master Nov 4, 2022
@julienfalque
Copy link
Member

Thank you @kubawerlos.

@kubawerlos kubawerlos deleted the fix_trailing_comma_in_multiline branch November 4, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce new line for each array item if there's already at least one new line
4 participants