-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow to enable/disable plugin error codes #13419
base: master
Are you sure you want to change the base?
Allow to enable/disable plugin error codes #13419
Conversation
Fixes python#12987 * Ignore unknown error codes in process_options * Reload enabled / disabled error codes after loading plugins * Unknown errors codes no longer a hard failure, they only get logged to stderr
This comment has been minimized.
This comment has been minimized.
Following up to see where this PR leads. Having issues with supressing |
Just wanted to say thank you for this patchset, am also experiencing this issue in trying to suppress |
Also there's an additional error code validator in the config parser, I would suggest removing it so that pyproject.toml works - scottp-dpaw@4fe7aeb |
Are there any news on this? I'm also on the bandwagon trying to suppress django-manager-missing from django-stubs and failing. @tik-stbuehler thanks for opening this, anything I can do to get it in? |
I can take a look when CI is green. |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
I rebased the changes on the latest master in https://github.com/scottp-dpaw/mypy/tree/v1.8.0_fixes |
Description
Fixes #12987
(I copied this from the way
warn_unused_configs
is handled, and I don't think parser errors can be triggered after plugins were loaded?)Duplicating the code seems a bit ugly, but the way the
Errors
instance is created before loading the plugins I'm not quite sure what the implications would be if the error code loading is delayed completely.(Another thing I noticed: the
Errors
constructor creates new sets when passed empty sets, but shares non-empty sets otherwise. That seems bad - probably should either share always or clone always.)Test Plan
No idea how to test plugins.
I used this manually (and successfully) by having something like this in
pyproject.toml
in a project using django: