-
-
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
--auto-gen-config not resolving all offenses after upgrading from 0.32.1 #2228
Comments
It would be great if you could run cd /path/to/rubocop_repo
git bisect start
git bisect good v0.32.1
git bisect bad v0.33.0
git bisect run /path/to/testscript.sh
git bisect reset
# testscript.sh
cd /path/to/code_base_where_problem_was_found
/path/to/rubocop_repo/bin/rubocop --auto-gen-config
/path/to/rubocop_repo/bin/rubocop |
👍 trying it now |
Kind of inconclusive. It found 3bc885c as the first bad commit, but it doesn't seem related to me |
Too bad. I was going to say that d8c7c37 was a prime suspect, but it was merged after 0.33.0 was released. Could you still try and see what happens if you |
@maxjacobson What if you |
Yea I think we moved on from the issue by manually resolving it, but I wanted to report it in case it's a bug that can be fixed. It's not a huge deal I think |
My point was, I think the problem may have been caused by the presence of the old |
Ah, got it. I was under the impression that the I'll revert our codebase to when I opened this issue... OK, yep, just reconfirmed the behavior from the original report. Trying now with removing the old file before generating the new one. No, it seems to have the same behavior. Still some offenses snuck through. |
OK, that's good to know. |
Is this codebase proprietary? |
Yes. If you'd like, I can try to reproduce it in a public codebase |
Please do. My technique for coming up with minimal repro:
|
Could this bug caused by this line?
|
I think this reproduces the bug:
test case:
output:
|
FWIW, it might be possible to trigger similar weirdness with For contrast, here there is no test for whether the cop is enabled: |
I think @madwort has done a nice job reproducing it. I tried but couldn't |
…-disabled-cops [Fixes #2228] Use the config of a related cop whether it's enabled or not
I'm having trouble reproducing this in an isolated code base, so here's the relevant information:
.rubocop_todo.yml
file, which was generated by rubocop 0.32.1Lint/EndAlignment
cop is set toAlignWith: variable
Lint/EndAlignment
offenses, butStyle/ElseAlignment
is disabled in the todo file.rubocop_todo.yml
is still the one generated by 0.32.1).rubocop_todo.yml
file, so I runbin/rubocop --auto-gen-config
and it regenerates my.rubocop_todo.yml
file.At this point, when I run
bin/rubocop
, there should be no offenses, right?I start getting a bunch of
Style/ElseAlignment
offenses.Before the regeneration (excerpts):
After the regeneration (excerpts):
Two interesting things:
Lint/EndAlignment
is disabled even though it's got a configuration (new offenses seem to have been discovered in 0.33 related to the alignment of theend
of case statements, but I'm not sure which entry in the changelog is responsible for this)Style/ElseAlignment
is no longer disabled, even though those offenses didn't go anywhere, so now I have a bunch of new offensesDesired behavior: after running
bin/rubocop --auto-gen-config
, there would be no offensesThe text was updated successfully, but these errors were encountered: