Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #9905] Fix single line concatenation false positive
By checking that the inspected node is multiline, we should get rid of this false positive. Happens for code like puts 'a'"#{b}" We're also checking that none of the children is multiline. This is done to skip weird corner cases that are impossible to have a consistent alignment rule for. It turns out that the new multiline checks make it possible to remove a couple of old conditions when checking if it's a concatenation with backslashes we're inspecting. It is perhaps possible to search for backslash and newline in the code, but I'd like to avoid that, because I'm afraid of other weird corner cases if we take the regexp search approach.
- Loading branch information
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#9905](https://github.com/rubocop/rubocop/issues/9905): Fix false positive for single line concatenation in `Layout/LineEndStringConcatenationIndentation`. ([@jonas054][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters