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

WordArray should allow multi-line arrays of words #554

Closed
lamont-granquist opened this issue Oct 9, 2013 · 2 comments
Closed

WordArray should allow multi-line arrays of words #554

lamont-granquist opened this issue Oct 9, 2013 · 2 comments
Labels

Comments

@lamont-granquist
Copy link

array = [
  "foo" # comment here
  "bar" # this thing was done because of a bug
  "baz" # don't delete this line or the LHC destroys the universe
]

does not translate to %w[] notation

array = %w[
  foo # this is not a comment it is a bunch of words
  bar
  baz
]

commenting like that is a perfectly reasonable thing to want to do. WordArray should only apply to single-line arrays.

(and i'm not a big fan of the stringliterals rule as well...)

@jonas054
Copy link
Collaborator

I've changed the labeling from enhacement to bug. When the string items are commented, it's not possible to change the array to %w notation and still comment on the items. RuboCop should leave it.

BTW, @lamont-granquist, have you noticed that StringLiterals is configurable and can enforce single quotes or double quotes (or be turned off). 😄

@lamont-granquist
Copy link
Author

Yep, configurable FTW... =)

I'll probably turn WordArray back on after this is fixed...

@bbatsov bbatsov closed this as completed in 5b66c7f Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants