We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HashSyntax autocorrection results in a broken return syntax if the braces were not included.
return
return :a => 1
should get autocorrected to:
return {a: 1}
Gets corrected to:
return a: 1
Which gives:
SyntaxError ((irb):6: syntax error, unexpected ':', expecting keyword_end)
rubocop --only Style/HashSyntax -a ...
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
rubocop -V
bundle exec rubocop -V
0.83.0 (using Parser 2.7.1.2, running on ruby 2.5.8 x86_64-darwin18)
The text was updated successfully, but these errors were encountered:
[Fix rubocop#7972] Fix an incorrect autocrrect for Style/HashSyntax
Style/HashSyntax
4b93dd1
Fixes rubocop#7972. Fix an incorrect autocorrect for `Style/HashSyntax` when using a return value uses `return`.
[Fix #7972] Fix an incorrect autocorrect for Style/HashSyntax (#7973)
fa3dcaf
Fixes #7972. Fix an incorrect autocorrect for `Style/HashSyntax` when using a return value uses `return`.
Successfully merging a pull request may close this issue.
HashSyntax autocorrection results in a broken
return
syntax if the braces were not included.Expected behavior
should get autocorrected to:
Actual behavior
Gets corrected to:
Which gives:
Steps to reproduce the problem
rubocop --only Style/HashSyntax -a ...
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: