Skip to content
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

Style/ExplicitBlockArgument cop fails for safe navigation operator #8671

Closed
kolobock opened this issue Sep 9, 2020 · 2 comments · Fixed by #8672
Closed

Style/ExplicitBlockArgument cop fails for safe navigation operator #8671

kolobock opened this issue Sep 9, 2020 · 2 comments · Fixed by #8672
Labels

Comments

@kolobock
Copy link

kolobock commented Sep 9, 2020

I am having an issue with inspecting this part of the code:

results['results']&.each do |row|
  yield row                       
end 

An error occurred while Style/ExplicitBlockArgument cop was inspecting

It inspects a code fine if remove & safe navigation from the code.

Rubocop 0.89.1 (using Parser 2.7.1.4, rubocop-ast 0.3.0, running on ruby 2.7.1 x86_64-darwin18)

Attaching debug log from rubocop -d run
rubocop.out.txt

@koic koic transferred this issue from rubocop/ruby-style-guide Sep 9, 2020
@koic koic added the bug label Sep 9, 2020
koic added a commit to koic/rubocop that referenced this issue Sep 9, 2020
Fixes rubocop#8671.

This PR fixes an error for `Style/ExplicitBlockArgument` when using
safe navigation method call.
@kolobock
Copy link
Author

kolobock commented Sep 9, 2020

@koic ,
thank you! you are like a rocket

@koic
Copy link
Member

koic commented Sep 9, 2020

You are welcome!

bbatsov pushed a commit that referenced this issue Sep 9, 2020
Fixes #8671.

This PR fixes an error for `Style/ExplicitBlockArgument` when using
safe navigation method call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants