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
Invalid autocorrect for Style/HashSyntax #12312
Labels
Comments
I cannot reproduce that issue. If only the |
Yes: You can reproduce by pulling this commit: sul-dlss/purl@c12d669 then changing the ruby language to 3.2 and then autocorrecting with rubocop. |
Here's a minimal test case: # test.rb
if Settings.embed.url
Settings.embed.url % { druid: druid }
else
purl_url(druid)
end # .rubocop.yml
AllCops:
TargetRubyVersion: 3.2
Style/FrozenStringLiteralComment:
Enabled: false
Style/FormatString:
Enabled: false |
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Oct 26, 2023
Fixes rubocop#12312. This PR fixes an incorrect autocorrect for `Style/HashSyntax` when braced hash key and value are the same and it is used in `if`...`else`.
bbatsov
pushed a commit
that referenced
this issue
Oct 26, 2023
Fixes #12312. This PR fixes an incorrect autocorrect for `Style/HashSyntax` when braced hash key and value are the same and it is used in `if`...`else`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was a String format operator, but it gets transformed to be a String quotation.
The text was updated successfully, but these errors were encountered: