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 positive on the Style/HashEachMethods
cop for array destructuring
#12444
Comments
ydakuka
changed the title
Fix false positive on the
False positive on the Dec 2, 2023
Style/HashEachMethods
copStyle/HashEachMethods
cop
ydakuka
changed the title
False positive on the
False positive on the Dec 2, 2023
Style/HashEachMethods
copStyle/HashEachMethods
cop for array destructuring
8 tasks
Thanks for PR, not sure if it got solved but I had issue with the same cop with this: [1, 2, 3].zip([[4, 5], [5, 6], [6, 7]]).each do |a, (b, c)|
puts("#{a} - #{b} - #{c}")
end I could report it as separate issue if needed. |
ilvez, it will be solved here: #12441 |
@ydakuka Thank you for quick response! |
8 tasks
Also came here after getting this blatant false positive:
extensions.each do |name,(value,critical)|
ext = extension_factory.create_extension(name,value,critical)
cert.add_extension(ext)
end |
False positive here too [{ 'name' => 'foo' }, { 'name' => 'bar' }].each do |attributes, name: attributes['name']|
do_something_with_name(name)
end |
jmartin-sul
added a commit
to sul-dlss/was-registrar-app
that referenced
this issue
Dec 5, 2023
false positive, see e.g. rubocop/rubocop#12444
koic
added a commit
to koic/rubocop
that referenced
this issue
Dec 10, 2023
Fixes rubocop#12444. This PR fixes false positive for `Style/HashEachMethods` when receiver literal is not a hash literal.
bbatsov
pushed a commit
that referenced
this issue
Dec 10, 2023
Fixes #12444. This PR fixes false positive for `Style/HashEachMethods` when receiver literal is not a hash literal.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual behavior
Before autocorrection
output:
After autocorrection
output:
Rubocop
The text was updated successfully, but these errors were encountered: