-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positives for
Style/SymbolArray
This PR fixes false positives for `Style/SymbolArray` when `%i` array containing unescaped `[`, `]`, `(`, or `)`. I noticed the following false positive in the RuboCop AST repository: ```console $ cd path/to/rubocop-ast $ bundle exec rubocop --only Style/SymbolArray (snip) spec/rubocop/ast/node_pattern/lexer_spec.rb:36:9: C: [Correctable] Style/SymbolArray: Use [:'(', :array, :sym, :'$', :int, :+, :x, :')'] for an array of symbols. %i[( array sym $ int + x )] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 163 files inspected, 1 offense detected, 1 offense autocorrectable ```
- Loading branch information
Showing
3 changed files
with
17 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#12119](https://github.com/rubocop/rubocop/pull/12119): Fix false positives for `Style/SymbolArray` when `%i` array containing unescaped `[`, `]`, `(`, or `)`. ([@koic][]) |
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