Skip to content
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

[0.76.0] Layout/MultilineHashBraceLayout auto-correct not correcting #7520

Closed
shaicoleman opened this issue Nov 21, 2019 · 4 comments
Closed
Assignees
Labels

Comments

@shaicoleman
Copy link

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)
@koic koic added the bug label Nov 22, 2019
@stale
Copy link

stale bot commented May 20, 2020

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!

@stale stale bot added the stale Issues that haven't been active in a while label May 20, 2020
@shaicoleman
Copy link
Author

Still happening with 0.83.0

@stale stale bot removed the stale Issues that haven't been active in a while label May 20, 2020
@marcandre
Copy link
Contributor

I hope that #7868 will automagically fix this.

@marcandre marcandre self-assigned this May 21, 2020
@marcandre
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants