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

Symbol/WordArray style "percent" should also consider [ ] chars as "bad" #11802

Closed
johnnyshields opened this issue Apr 15, 2023 · 2 comments
Closed
Labels
feature request good first issue Easy task, suitable for newcomers to the project

Comments

@johnnyshields
Copy link

johnnyshields commented Apr 15, 2023

The current behavior of the Symbol/WordArray cop's default style ("percent") is as follows:

# bad
[:foo, :[]=]

# bad (contains spaces)
%w[foo\ bar baz\ quux]

# good (allows [ ] chars)
%i[foo \[\]=]

I think we should change this so that [ ] trigger the same special handling that space char does, and the preferred style here would be [:foo, :[]=]

@bbatsov
Copy link
Collaborator

bbatsov commented May 14, 2023

Makes sense to me. PR welcome!

@bbatsov bbatsov added the good first issue Easy task, suitable for newcomers to the project label May 14, 2023
@koic koic closed this as completed in 80acfbd Jul 21, 2023
koic added a commit that referenced this issue Jul 21, 2023
…_style_symbol_array

[Fix #11802] Improve handling of [] and () with percent symbol arrays
@johnnyshields
Copy link
Author

@koic Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

No branches or pull requests

2 participants