forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix rubocop#13677] Fix false negative on `Style/RedundantLineContinu…
…ation` when the continuation is followed by a percent array Previously, `start_with_arithmetic_operator?` used a regexp to check if the following line starts with an arithmetic operator (`+`, `-`, `*`, `/` or `%`). However, a percent array (eg. `%i[foo bar]`) also starts with a `%`, and as such, was being marked as a required continuation. This has been corrected now to check against the first token of the line rather than the first character. Additionally, the previous regex masked instances where arguments to an unparenthesized method call started with an arithmetic operator character; these cases are now properly handled.
- Loading branch information
1 parent
f852457
commit edb6f2b
Showing
3 changed files
with
64 additions
and
5 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 @@ | ||
* [#13677](https://github.com/rubocop/rubocop/issues/13677): Fix false negative on `Style/RedundantLineContinuation` when the continuation is followed by a percent array. ([@dvandersluis][]) |
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