You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Layout/MultilineHashBraceLayout cop reports auto-correct has corrected an issue, when it doesn't actually change the file.
example.rb:
{ a: 1,
b: 2 # comment
}.compact
rubocop --only Layout/MultilineHashBraceLayout --auto-correct example.rb
client.rb:3:1: C: [Corrected] Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
# On the second run it's expected not to find the same issue
rubocop --only Layout/MultilineHashBraceLayout --auto-correct example.rb
client.rb:3:1: C: [Corrected] Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
rubocop -V
0.76.0 (using Parser 2.6.2.1, running on ruby 2.6.5 x86_64-linux)
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
I can confirm that master no longer reports the offense has being corrected, yay.
I feel that the presence of the comment makes an autocorrection not necessarily a good idea (it applies to the b: 2, not the .compact), so I'm closing this, but feel free to reopen if you think it should autocorrect nevertheless.
The
Layout/MultilineHashBraceLayout
cop reports auto-correct has corrected an issue, when it doesn't actually change the file.example.rb
:The text was updated successfully, but these errors were encountered: