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
Lint/SymbolConversion to provide an additional "consistent" option #9621
Comments
I think this is a good suggestion, I'm going to take a look. |
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Mar 19, 2021
…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.
8 tasks
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Mar 22, 2021
…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.
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Mar 22, 2021
…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.
bbatsov
pushed a commit
that referenced
this issue
Mar 22, 2021
…ire 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.
That was quick! Thanks @dvandersluis and @bbatsov. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
For hashes where keys are mixed, wouldn't having a consistent key structure be more readable than be forced to use symbols for some keys and strings for the rest -
raises a
Lint/SymbolConversion
violation.Describe the solution you'd like
No violations for:
(OR)
violates for :
The text was updated successfully, but these errors were encountered: