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
When letting Layout/SpaceInsideHashLiteralBraces autocorrect code containing the text '{' as the last value in a hash, invalid code will be generated.
Layout/SpaceInsideHashLiteralBraces
'{'
Slightly related to #3958 and #3976.
With EnforcedStyleForEmptyBraces: space, autocorrect
EnforcedStyleForEmptyBraces: space
h = { a: '{'}
into
h = { a: '{' }
With EnforcedStyleForEmptyBraces: no_space, autocorrect
EnforcedStyleForEmptyBraces: no_space
h = {a: '{' }
h = {a: '{'}
With EnforcedStyleForEmptyBraces: space, autocorrects
(with “Infinite loop detected”)
With EnforcedStyleForEmptyBraces: no_space, autocorrects
h = {a:' }
$ ❯ be rubocop -V 1.61.0 (using Parser 3.3.0.5, rubocop-ast 1.31.1, running on ruby 3.3.0) [arm64-darwin22] - rubocop-performance 1.20.2 - rubocop-rake 0.6.0 - rubocop-rspec 2.27.1
The text was updated successfully, but these errors were encountered:
[Fix #12736] Fix invalid autocorrect in Layout/SpaceInsideHashLiteral…
7127a1b
…Braces
bquorning
Successfully merging a pull request may close this issue.
When letting
Layout/SpaceInsideHashLiteralBraces
autocorrect code containing the text'{'
as the last value in a hash, invalid code will be generated.Slightly related to #3958 and #3976.
Expected behavior
With
EnforcedStyleForEmptyBraces: space
, autocorrectinto
With
EnforcedStyleForEmptyBraces: no_space
, autocorrectinto
Actual behavior
With
EnforcedStyleForEmptyBraces: space
, autocorrectsinto
(with “Infinite loop detected”)
With
EnforcedStyleForEmptyBraces: no_space
, autocorrectsinto
RuboCop version
The text was updated successfully, but these errors were encountered: