Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress an offenses when using
rubocop --enable-pending-cops
This PR suppresses a RuboCop offenses when using `rubocop --enable-pending-cops`. ```console % path/to/rubocop % ./exe/rubocop --enable-pending-cops (snip) Offenses: lib/rubocop/config_loader.rb:58:14: C: Style/HashEachMethods: Use each_key instead of keys.each. hash.keys.each do |key| ^^^^^^^^^ lib/rubocop/cop/lint/percent_string_array.rb:45:18: C: Style/HashEachMethods: Use each_value instead of values.each. node.values.each do |value| ^^^^^^^^^^^ 1142 files inspected, 2 offenses detected ``` `Style/HashEachMethods` cop will be enabled by default in RuboCop 1.0. And this PR adds `each_value` method to `ArrayNode` for prevents the following `NoMethodError`. ```console RuboCop::ErrorWithAnalyzedFileLocation: cause: #<NoMethodError: undefined method `each_value' for #<RuboCop::AST::ArrayNode:0x00007fb46e9d5628> Did you mean? each_node> ```
- Loading branch information
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters