-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
ConvertTry produces invalid Ruby #126
Comments
It's a conflict between |
We seem to be getting more and more issues about auto-correction conflicts between cops. I'm starting to think that we need a better way to run auto-correction. Rather than running the corrections back to back, we need some way to check if the source has changed since we registered the offense. If it has, we need to skip auto-correction or recheck the code for an offense/correction. |
This is strange. Did we make changes to the correction loop lately? It looks like both cops are attempting to correct the code on the same pass, which is not how it used to work. 🤔 When applying |
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! |
…tion` Fixes rubocop#126. This PR fixes an incorrect auto-correct for `Rails/SafeNavigation` with `Style/RedndantSelf`.
…_safe_navigation [Fix #126] Fix an incorrect auto-correct for `Rails/SafeNavigation`
Expected behavior
Given this source:
And this Rubocop config:
I expected auto-correction to produce working Ruby.
Actual behavior
Auto-correction produces this output:
Which does not parse. The Rubocop output is:
Steps to reproduce the problem
Run
rubocop -a
with the above source and config. Note that setting the target Ruby version to 2.2 (the lowest supported) produces working Ruby (it leaves thetry
in place).RuboCop version
The text was updated successfully, but these errors were encountered: