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

[Fix #7592] Line end concatenation indentation cop #9883

Merged
merged 3 commits into from Jun 23, 2021

Conversation

jonas054
Copy link
Collaborator

The cop Layout/MultilineOperationIndentation doesn't view the backslash as an operator, which is correct. Therefore, a new cop is needed to inspect character literals broken up into multiple lines with backslashes at the ends of the lines.

The new cop deals exclusively with string literals, not any other constructs where backslashes might be used to "glue" lines together.

The cop Layout/MultilineOperationIndentation doesn't view the
backslash as an operator, which is correct. Therefore, a new cop
is needed to inspect character literals broken up into multiple
lines with backslashes at the ends of the lines.

The new cop deals exclusively with string literals, not any other
constructs where backslashes might be used to "glue" lines
together.
@bbatsov bbatsov merged commit 0741555 into rubocop:master Jun 23, 2021
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 23, 2021

Good work! One can argue that often a more suitable correction would be a heredoc, but the cop's definitely a step in the right direction (consistency).

koic added a commit to rubocop/rubocop-minitest that referenced this pull request Jun 23, 2021
koic added a commit to rubocop/rubocop-performance that referenced this pull request Jun 23, 2021
koic added a commit to rubocop/rubocop-rails that referenced this pull request Jun 23, 2021
@jonas054 jonas054 deleted the 7592_LineEndConcatenationIndentation branch June 27, 2021 08:54
@bquorning
Copy link
Contributor

This PR fixes part 2 of #6420, thank you 🥇

I actually mentioned @jonas054 on that issue, because I knew he’d be a good candidate to tackle those problems. I don’t know if the other parts of that issue are possible to fix, given the limitations of Parser.

renawatson68 added a commit to renawatson68/performance-develop-rubyonrails that referenced this pull request Sep 23, 2022
richardstewart0213 added a commit to richardstewart0213/performance-build-Performance-optimization-analysis- that referenced this pull request Nov 4, 2022
MarttiCheng added a commit to MarttiCheng/Rubocop-Performance that referenced this pull request Sep 28, 2023
SerhiiMisiura added a commit to SerhiiMisiura/Rubocop-Performance that referenced this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants