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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Style/WordArray for subarrays #11370

Merged
merged 1 commit into from
Jan 1, 2023

Conversation

fatkodima
Copy link
Contributor

In #11334, I introduced a bug for nested arrays 馃槓

[['one', 'One'], 2, 3]
     Failure/Error: parent.values.any? { |subarray| complex_content?(subarray.values) }

     NoMethodError:
       undefined method `values' for s(:int, 2):RuboCop::AST::IntNode
       Did you mean?  value
     # ./lib/rubocop/cop/style/word_array.rb:103:in `block in within_2d_array_of_complex_content?'
     # ./lib/rubocop/cop/style/word_array.rb:103:in `any?'
     # ./lib/rubocop/cop/style/word_array.rb:103:in `within_2d_array_of_complex_content?'
     # ./lib/rubocop/cop/style/word_array.rb:88:in `on_array'
     # ./lib/rubocop/cop/commissioner.rb:101:in `public_send'
     # ./lib/rubocop/cop/commissioner.rb:101:in `block (2 levels) in trigger_responding_cops'
     # ./lib/rubocop/cop/commissioner.rb:165:in `with_cop_error_handling'
     # ./lib/rubocop/cop/commissioner.rb:100:in `block in trigger_responding_cops'
     # ./lib/rubocop/cop/commissioner.rb:99:in `each'
     # ./lib/rubocop/cop/commissioner.rb:99:in `trigger_responding_cops'
     # ./lib/rubocop/cop/commissioner.rb:69:in `on_array'

@bbatsov bbatsov merged commit 3cce8c8 into rubocop:master Jan 1, 2023
@bbatsov
Copy link
Collaborator

bbatsov commented Jan 1, 2023

Thanks!

@fatkodima fatkodima deleted the fix-word_array-nested-not-2d branch January 1, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants