-
Notifications
You must be signed in to change notification settings - Fork 11
Check that we disable pylint messages by name and not code #34
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
Conversation
a352731 to
c164a14
Compare
|
I believe the checkers have access to the linter as a member of |
| """.strip()) | ||
|
|
||
| with self.assertAddsMessages(*[ | ||
| pylint.testutils.Message('disable-name-only', line=line, args={'code': code, 'name': 'unknown'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't the linter know the suggested name for any of these codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tests it's not a real linter, it's a pylint.testutils.UnittestLinter which has no msgs_store to query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a way to add this info to the linter to prove that it actually pulls it out, then we should add that. If it's too hacky though, don't worry about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
155c83b to
78f5236
Compare
This PR adds a check to ensure that source code disables rules by message name and not message code. Fixes #32.
If a bad message code is mentioned in a disable comment, in addition to
bad-option-valuewe output a message suggestingunknownas a code (in casebad-option-valuehas been disabled):