-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
False negative for Style/RedundantLineContinuation
when the following line starts with a percent array
#13677
Labels
Comments
Style/RedundantLineContinuation
copStyle/RedundantLineContinuation
Style/RedundantLineContinuation
Style/RedundantLineContinuation
when the following line starts with a percent array
I split the second example to #13688 because there are two different bugs to fix here. |
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
8 tasks
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 13, 2025
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Jan 15, 2025
…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.
dvandersluis
added a commit
that referenced
this issue
Jan 15, 2025
[Fix #13677] Fix false negative on `Style/RedundantLineContinuation` when the continuation is followed by a percent array
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the solution you'd like
RuboCop
The text was updated successfully, but these errors were encountered: