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
custom rule derived from FileName rule can no longer be disabled in 1.63 #12835
Comments
See #12802, which I'm guessing resulted in this change for you. I think global offenses can be disabled only in the cop configuration (you can exclude the file from being checked by the cop), but I may be mistaken about this. |
There are quite a few places that do disable I didn't anticipate this behaviour change, I will open a PR to continue supporting these cases, though I think the config would be a more appropriate place for this. |
… comments `Naming/FileName` now returns global offenses but there are quite a few projects that disable the cop with a comment. The change to global offenses broke that behaviour.
… comments `Naming/FileName` now returns global offenses but there are quite a few projects that disable the cop with a comment. The change to global offenses broke that behaviour.
`Naming/FileName` now returns global offenses but there are quite a few projects that disable the cop with a comment. The change to global offenses broke that behaviour.
If you have a custom FileName rule defined, say
Acme/FileName
that is derived from theFileName
rule, you are now unable to disable it with# rubocop:disable Acme/FileName
at the top of the file in version 1.63+. Rubocop is insisting that the violation must be fixed.Expected behavior
# rubocop:disable Acme/FileName
should continue to disable the custom rule on a per file basis as it did in 1.62 and prior.Actual behavior
It does not disable the rule and insists we fix the violation.
Steps to reproduce the problem
Create a custom rule based on FileName:
require the rule in your
rubocop.yml
, then create a file that violates the naming rule and try adding:run:
bundle exec rubocop --only Acme/FileName <filename>
Notice the disable does not work.
RuboCop version
The text was updated successfully, but these errors were encountered: