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
[Fix #9621] Add consistent
style to Lint/SymbolConversion
to require all symbol keys in a hash to use the same convention
#9623
Conversation
@rubocop/rubocop-core one thing that I'm not sure about is that Separately, I am using the configuration from |
Most Lint cops shouldn't have different supported styles, but I guess that's OK in the current situation. Alternatively this can also be some flag like "AllowConsistentSymbolsInHash" or something along those lines. I'm fine with the current approach as well.
I think that's fine. |
@@ -21,10 +27,26 @@ module Lint | |||
# :underscored_symbol | |||
# :'hyphenated-string' | |||
# | |||
# @example EnforcedStyle: consistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to add the strict
case for hashes as well, so it's clearer what this means for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbatsov I added additional documentation, thanks!
ac8e20f
to
92ad865
Compare
…to require all symbol keys in a hash to use the same convention. The `consistent` style works the same as the previous default style (now called `strict`), in that symbol conversions should be explicit. However, in the case of a hash with a mix of symbol keys requiring quoting and not, this style now enforces that all keys are quoted for consistency.
92ad865
to
e2a52b1
Compare
Thanks! |
The
consistent
style works the same as the previous default style (now calledstrict
), in that symbol conversions should be explicit. However, in the case of a hash with a mix of symbol keys requiring quoting and not, this style now enforces that all keys are quoted for consistency.Fixes #9621.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.