-
-
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
Lint/Debugger autocorrect doesn't remove conditonals #3400
Comments
After playing around with this, it looks like it also indiscriminately auto-corrects things like:
into:
|
Confirmed as a bug. |
@jonas054 I was thinking how to fix this issue, and came up with a few possible approaches:
What do you think? |
I recommend option 1. It's too hard to get autocorrection right for this cop, because even if you implement the conservative autocorrection according to option 2, there's still the question of comments around the removed code that may have become irrelevant or incorrect. |
I agree with @jonas054. I would rather have a simple cop that does 80% of the job than an overly complex one that does 90% and is prone to bugs. 🙂 |
Sounds good 👍 |
It was decided to cancel auto-correction for this cop (see discussion in issue rubocop#3400) because it is too copmlex to implement correctly, and probably not worth the effort.
If you have code like:
and you run the autocorrect it will leave:
which causes:
0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.0 x86_64-darwin14)
The text was updated successfully, but these errors were encountered: