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/WordArray peculiar autocorrect error #11284

Closed
pirj opened this issue Dec 14, 2022 · 0 comments · Fixed by #11285
Closed

Style/WordArray peculiar autocorrect error #11284

pirj opened this issue Dec 14, 2022 · 0 comments · Fixed by #11285
Labels

Comments

@pirj
Copy link
Member

pirj commented Dec 14, 2022

Source:

  FOO = %w[
    admin
    one@example.com
    two@example.com
    three@example.com
    four.four@gmail.com
    five@example.com
    six@example.com
    seven@example.com
    eight@example.com
    nine@example.com
    ten@example.com
  ].freeze

After corection:

  FOO = [ample'admin',    s'one@example.com',    s'two@example.com',    s'three@example.com',    s'four.four@gmail.com',    s'five@example.com',    s'six@example.com',    s'seven@example.com',    s'eight@example.com',    s'nine@example.com',    s'ten@example.com'].freeze

Expected behavior

The resulting array is the same, just in a different notation.

Actual behavior

Array is broken.

Steps to reproduce the problem

See above

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:

$ rubocop -V
1.37.1 (using Parser 3.1.2.1, rubocop-ast 1.23.0, running on ruby 2.7.5) [x86_64-linux]
  - rubocop-performance 1.15.0
  - rubocop-rails 2.17.2
  - rubocop-rspec 2.14.2
@koic koic added the bug label Dec 14, 2022
koic added a commit to koic/rubocop that referenced this issue Dec 14, 2022
Fixes rubocop#11284.

This PR fixes an incorrect autocorrect for `Style/WordArray`
when assigning `%w()` array.
bbatsov pushed a commit that referenced this issue Dec 14, 2022
Fixes #11284.

This PR fixes an incorrect autocorrect for `Style/WordArray`
when assigning `%w()` array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants