-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Autocorrect for Rails/Presence corrupts code when there's an elsif
block
#5479
Comments
This is a real problem. This is happening in tons of projects I guess ! |
wata727
added a commit
to wata727/rubocop
that referenced
this issue
Jan 18, 2018
Fixes rubocop#5479 `elsif` and` unless` are treated as `if` node. However, if using `present?` with `elsif`, this cop corrupts code by auto-correction. So change it to ignore the `elsif` node.
8 tasks
bbatsov
pushed a commit
that referenced
this issue
Jan 20, 2018
Fixes #5479 `elsif` and` unless` are treated as `if` node. However, if using `present?` with `elsif`, this cop corrupts code by auto-correction. So change it to ignore the `elsif` node.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
I would expect rubocop to leave this code unchanged
Actual behavior
The autocorrect is corrupting the surrounding code, by misplacing the elsif clause
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: