-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Wrong number of autocorrections #9175
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
Comments
This is a continuation of #8978 and #9073. |
8 tasks
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Dec 8, 2020
…s not always possible.
marcandre
added a commit
to marcandre/rubocop
that referenced
this issue
Dec 8, 2020
This addresses a few things: 1) Calling `add_offense` or `add_offense { |corrector| # don't auto-correct }` should be handled the same way. An empty corrector is now replaced by `nil`. 2) Tweaks how the status is handled. Status `:uncorrected` is reserved for cases where there is a corrector but it is not applied. 3) Old style cops' `auto_correct` method is now called even when run without auto-correction. This way we can know if they can auto-correct or not. It also simplifies logic. I should have done 3) during my refactor (I don't see how it could be incompatible)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running
rubocop -a --only=Layout/LineLength
, it displays a total of 12 offenses, of which 7 were autocorrected. In fact, none of those offenses were corrected.Here, for example, an offense was supposedly corrected, although nothing in this line was changed. And, sure enough, next time I run the same command, the offense shows up again.
I am not sure what is causing the problem as it seems to occur randomly on different line lengths (150-190 characters in my case).
Expected behavior
Either not to show that the offense was corrected, or correct it once and for all.
Steps to reproduce the problem
In rubocop.yml, specify
Then run the autocorrection on the line above.
RuboCop version
The text was updated successfully, but these errors were encountered: