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
NoBlankLines*: fix removing lines consisting only of spaces #4109
NoBlankLines*: fix removing lines consisting only of spaces #4109
Conversation
how about merging those into |
There's a difference between "no extra" (meaning at most 1) or "no" (meaning 0). I'd be for combining the ones pointed out into a single fixer (just like the |
if I expect 0 than 1 is |
But how are you going to configure where you expect zero and where one? Sounds like configuration hell. I for one, wouldn't want |
Okay, as there obviously going to be discussion about new fixer to remove blank lines let's focus here about fixing the bugs only. |
@@ -1,22 +0,0 @@ | |||
--TEST-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not remove tests.
ever
you found out nice optimization? cool, apply it and leave the test present, so during refactoring year later, it will still work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, I haven't thought about moving it from priority
to misc
. Next time I will remember.
Thank you @kubawerlos. |
… (kubawerlos, keradus) This PR was squashed before being merged into the 2.12 branch (closes #4109). Discussion ---------- NoBlankLines*: fix removing lines consisting only of spaces We have 3 `NoBlankLines*` fixers and they behave differently for lines consisting only of spaces: - `NoBlankLinesAfterClassOpeningFixer` - removes line of spaces only when next line is indented - `NoBlankLinesAfterPhpdocFixer` - same as above - `NoBlankLinesBeforeNamespaceFixer` - removes indentation of the next line What would be the proper behaviour (apart of removing indentation of next line what is obviously a bug) - to keep lines consisting only of spaces or to remove them? _Tests are to demonstrate the problem, obviously have to be fixed as well._ Commits ------- 7df251c NoBlankLines*: fix removing lines consisting only of spaces
We have 3
NoBlankLines*
fixers and they behave differently for lines consisting only of spaces:NoBlankLinesAfterClassOpeningFixer
- removes line of spaces only when next line is indentedNoBlankLinesAfterPhpdocFixer
- same as aboveNoBlankLinesBeforeNamespaceFixer
- removes indentation of the next lineWhat would be the proper behaviour (apart of removing indentation of next line what is obviously a bug) - to keep lines consisting only of spaces or to remove them?
Tests are to demonstrate the problem, obviously have to be fixed as well.