Open ydakuka opened 9 months ago
To add to the above, I'm seeing this issue crop up in the RuboCop 1.61.0 release for the first time as well. Here's a few more examples:
# Example: String Concatenation
expect(temp_dir.join("test/Procfile.dev").read).to eq(
%(web: rerun --dir app,config,lib,slices --pattern="**/*.{erb,rb}" ) \ # <-- Flagged, incorrectly, as redundant line continuation
"-- bundle exec puma --config ./config/puma.rb\n" \
"assets: bundle exec hanami assets watch\n"
)
# Example: Pattern Matching
parameters in [[:rest]] \ # <-- Flagged, incorrectly, as redundant line continuation
| [[:keyrest]] \. # <-- Flagged, incorrectly, as redundant line continuation
| [[:rest], [:keyrest]] \ # <-- Flagged, incorrectly, as redundant line continuation
| [[:rest, :*]] \ # <-- Flagged, incorrectly, as redundant line continuation
| [[:keyrest, :**]] \ # <-- Flagged, incorrectly, as redundant line continuation
| [[:rest, :*], [:keyrest, :**]]
I'm facing the same issue.
$ cat backslash.rb
puts foo(123,
123) \
== bar
$ bundle exec rubocop backslash.rb
Inspecting 1 file
C
Offenses:
backslash.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
puts foo(123,
^
backslash.rb:2:15: C: [Correctable] Style/RedundantLineContinuation: Redundant line continuation.
123) \ ...
^
1 file inspected, 2 offenses detected, 2 offenses autocorrectable
@akimd can you make a new issue? This is about code that should register an offense. I think your problem is about the opposite?
Bummer, I read "false positive", but it's about false negatives, you are right. Sorry.
Describe the solution you'd like
Rubocop