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

Style/ConcatArrayLiterals autocorrection isn't working #11325

Closed
lucascaton opened this issue Dec 23, 2022 · 0 comments · Fixed by #11328
Closed

Style/ConcatArrayLiterals autocorrection isn't working #11325

lucascaton opened this issue Dec 23, 2022 · 0 comments · Fixed by #11328

Comments

@lucascaton
Copy link

Expected behavior

Docs says this cop supports autocorrection:

image

Actual behavior

Autocorrection is not working (not even with -A flag):

$ rubocop -A

# (...)

Offenses:

file.rb:33:17: C: Style/ConcatArrayLiterals: Use push with elements as arguments without array brackets instead of concat(%i[subject preview_text audience body sender_id]).
          attrs.concat(%i[subject body])
                ^^^^^^^^^^^^^^^^^^^^^^^^

162 files inspected, 1 offense detected

Steps to reproduce the problem

Here's the tested Ruby code:

attrs.concat(%i[subject body])

RuboCop version

$ rubocop -V
1.41.1 (using Parser 3.1.3.0, rubocop-ast 1.24.0, running on ruby 3.1.3) [arm64-darwin22]
  - rubocop-performance 1.15.1
  - rubocop-rails 2.17.3
  - rubocop-rspec 2.16.0
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 a pull request may close this issue.

1 participant