-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement a checker to validate that q uses SearchFIlter #106
Conversation
Also match the pylint method of using BaseChecker for their MSGS class.
from pylint.typing import MessageDefinitionTuple | ||
|
||
|
||
class MESSAGES: # pylint: disable=too-few-public-methods |
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.
Is there prior art for this in pylint or other pylint projects? I think we should try to be consistent with the parent library and their documentation in cases like pylint where the learning curve is already a cliff.
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.
Similar in their examples and their codebase. The difference is that they use multiple codes in a single class attribute, and they inherit from BaseChecker, but also combine some utils. I will post their code. I decided on using a separate attribute for each code to help solve the issue of finding all the codes used.
Here is an example, perhaps I could change this to MESSAGESMixin:
https://github.com/pylint-dev/pylint/blob/main/pylint/checkers/deprecated.py
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.
We decided after discussion with @cmsirbu and @glennmatthews that @smk4664 will have to do the work to revert these changes and we'll get a follow-up issue opened to introduce an invoke command to list out the current pylint message codes (pylint --list-msgs-enabled | grep 'nb-'
)
Co-authored-by: Gary Snider <[email protected]>
Closing, I will reopen with the rules, but following the latest comments from Gary. |
Closes #99
This PR implements a new checker to validate that Filtersets use SearchFilter for the
q
search instead of django_filters.CharField with a custom search method.