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

False positives for Style/SymbolArray in literal symbol array #12071

Closed
lostie opened this issue Jul 26, 2023 · 0 comments · Fixed by #12088
Closed

False positives for Style/SymbolArray in literal symbol array #12071

lostie opened this issue Jul 26, 2023 · 0 comments · Fixed by #12088

Comments

@lostie
Copy link

lostie commented Jul 26, 2023

Expected behavior

  • The Style/SymbolArray should not detect an offence when using square brackets in a symbol literal
  • The Style/SymbolArray should not detect an offence when using interpolation in a symbol literal

Actual behavior

Rubocop detect an Style/SymbolArray offence

Steps to reproduce the problem

%i[foo[4] bar[4]] # <= detects a `Style/SymbolArray` offence

%I[foo_#{index}] # <= detects a `Style/SymbolArray` offence

RuboCop version

$ bundle exec rubocop -V
1.55.0 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [arm64-darwin22]
  - rubocop-factory_bot 2.23.1
  - rubocop-graphql 1.3.0
  - rubocop-performance 1.18.0
  - rubocop-rails 2.20.2
  - rubocop-rake 0.6.0
  - rubocop-rspec 2.22.0
jasondoc3 added a commit to jasondoc3/rubocop that referenced this issue Aug 1, 2023
koic added a commit that referenced this issue Aug 1, 2023
…bol-array

[Fix #12071] Fix `Style/SymbolArray` false positives when using square brackets or interpolation in a symbol literal within a percent style array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant