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/HashEachMethods doesn't detect &blocks #11139

Closed
vlad-pisanov opened this issue Nov 1, 2022 · 0 comments · Fixed by #11140
Closed

Style/HashEachMethods doesn't detect &blocks #11139

vlad-pisanov opened this issue Nov 1, 2022 · 0 comments · Fixed by #11140
Labels

Comments

@vlad-pisanov
Copy link

Currently, Style/HashEachMethods detects regular blocks and numblocks, but ignores &blocks:

h.keys.each { ... }
# Style/HashEachMethods suggests: h.each_key { ... } ✔️

h.keys.each(&:foo)
# Style/HashEachMethods ignores ❌

Ideally, it should recommend:

h.each_key(&:foo)
@koic koic added the bug label Nov 2, 2022
ydah added a commit to ydah/rubocop that referenced this issue Nov 6, 2022
…when using each with a symbol proc argument

Fix: rubocop#11139
koic added a commit that referenced this issue Nov 6, 2022
[Fix #11139] Fix a false negative for `Style/HashEachMethods` when using each with a symbol proc argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants