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 gives a vague message when there are spaces in the array #10007

Closed
corroded opened this issue Aug 13, 2021 · 0 comments · Fixed by #10009
Closed

Style/WordArray gives a vague message when there are spaces in the array #10007

corroded opened this issue Aug 13, 2021 · 0 comments · Fixed by #10009

Comments

@corroded
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Related to #9981 , I think we can do slightly better by letting the user know that the array contains spaces. At the moment, it's a bit vague.

As an example, the word array in question was actually:

  NAV_DROPDOWN_LINKS = %w[
    First\ Second
  ].freeze

and I just got

Use `[]` for an array of words.

Like we're already using [] so I was wondering if it was because it was multiline. Until I saw #9962 in the release notes.

Describe the solution you'd like

I think maybe a clearer, more specific message should be more helpful? Use '[]' for words with spaces. or something to that effect?

koic added a commit to koic/rubocop that referenced this issue Aug 13, 2021
…Style/SymbolArray` cops

Fixes rubocop#10007 and rubocop#10008.

This PR tweaks offense message for `Style/WordArray` and `Style/SymbolArray` cops.
It is a clear message suggested by rubocop#10008.
bbatsov pushed a commit that referenced this issue Aug 16, 2021
…ymbolArray` cops

Fixes #10007 and #10008.

This PR tweaks offense message for `Style/WordArray` and `Style/SymbolArray` cops.
It is a clear message suggested by #10008.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants