-
-
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 negatives on the Style/RedundantLineContinuation
cop
#12430
Comments
Style/RedundantLineContinuation
copStyle/RedundantLineContinuation
cop
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:
RuboCop Version Details
|
Marked this as a follow up action because this is a known bug with link:https://github.com/rubocop/rubocop/issues/12430[RuboCop]. Milestone: patch
Marked this as a follow up action because this is a known bug with link:rubocop/rubocop#12430. Milestone: patch
Marked this as a follow up action because this is a known bug with link:rubocop/rubocop#12430. Milestone: patch
I'm facing the same issue.
|
@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. I opened #13145. |
@ydakuka's false negative examples (#12430 (comment)) and @bkuhlmann's false positive examples (#12430 (comment)) are all fixed now so I'm going to close this issue. |
@dvandersluis I checked my false negative examples, and except for the first one, they have not been fixed yet. ydakuka@yauhenid:~/Work/project$ bin/rails_docker rubocop -V
1.69.2 (using Parser 3.3.4.2, rubocop-ast 1.36.2, analyzing as Ruby 2.7, running on ruby 2.7.8) [x86_64-linux]
- rubocop-capybara 2.21.0
- rubocop-factory_bot 2.26.1
- rubocop-performance 1.23.0
- rubocop-rails 2.27.0
- rubocop-rake 0.6.0
- rubocop-rspec 3.3.0
- rubocop-rspec_rails 2.30.0
- rubocop-thread_safety 0.6.0 |
@ydakuka what version of rubocop are you using? I tried this on master, and all 5 continuations are flagged: # test.rb
# frozen_string_literal: true
def create
# TODO: some code
if @user.confirmed?
redirect_to user_path(@user),
notice: translate('confirmed') and return
elsif @user.condition?
redirect_to user_path(@user), \
notice: translate('not_confirmed') and return
end
# TODO: some code
end
let! :user do
create(:user,
my_foo: my_foo,
my_bar: my_bar, \
my_barbaz: my_barbaz)
end
let! :user do
create(:user, \
my_foo: my_foo, \
my_bar: my_bar,
my_baz: my_baz, \
my_foobar: my_foobar)
end
|
I am currently using rubocop version 1.69.2 I can provide snippets to help reproduce the issue: RSpec.describe User do
describe 'associations' do
specify do
expect(user).to \
belong_to(:profile)
end
end
describe '.custom_search' do
let! :user do
create(:user,
my_foo: my_foo,
my_bar: my_bar, \
my_barbaz: my_barbaz)
end
pending 'add tests'
end
end RSpec.describe OrderDecorator do
describe '#remained' do
let! :balance do
create(:balance, \
_id: order.id, value: value)
end
pending 'add tests'
end
describe '#document_link_tag' do
it 'returns link with proper content' do
expect(elem.inner_html).to eq \
Order.human_attribute_name(:document_link)
end
end
end |
…uation` when continuations are inside begin nodes
[Fix #12430] Fix false negatives in `Style/RedundantLineContinuation` when continuations are inside begin nodes
I updated rubocop to version RSpec.describe Campaigns::CloneInteractor do
let :campaign_location do
create(:campaign_location, \
%i[allowed disallowed].sample,
created_at: campaign_location_created_at)
end
pending 'add something'
end RSpec.describe 'POST /api/v1/rewards' do
def make_request
post send(:"user_#{provider_name}_omniauth_callback_path"), \
params: {},
headers: { 'ACCEPT' => 'text/html' }
end
pending 'add something'
end |
Can you make a new issue please? |
Sure, #13677 |
Describe the solution you'd like
Rubocop
The text was updated successfully, but these errors were encountered: