Skip to content

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

Merged
julienfalque merged 1 commit intoPHP-CS-Fixer:masterfrom
werlos:fix_trailing_comma_in_multiline
Nov 4, 2022
Merged

bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element#6677
julienfalque merged 1 commit intoPHP-CS-Fixer:masterfrom
werlos:fix_trailing_comma_in_multiline

Conversation

@kubawerlos
Copy link
Member

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

Comments