-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add a pseudo error code, all
, which enables all error codes
#19048
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
base: master
Are you sure you want to change the base?
Conversation
…and line although I actually have no idea why that would be the case, as the error for using it in configuration seems inexplicable, since it consults the same list of error codes in the end 🤷
This comment has been minimized.
This comment has been minimized.
d07c6fd
to
fde8f9a
Compare
…itives.pyi instead my plan after this, if this doesn't work, is to go to [typing fixtures/typing-full.pyi] ; I'm just blindly trying things
This comment has been minimized.
This comment has been minimized.
OK, I don't really understand the whole situation here with the stubs, but I guess I have to add @overload to a number of them. Whatever they're for. |
This comment has been minimized.
This comment has been minimized.
872aeb1
to
f1a4650
Compare
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
IMO this is less discoverable than a flag (e.g. |
Agree with @A5rocks - there was a ticket for |
This code change allows users to use
--enable-error-code all
to enable all error codes. This "fixes" #2376 (which was closed as not planned — but a decade of hindsight has, I think, revealed that the idea for a flag like this is more practical than it initially seemed). It also addresses a feature request that was mentioned in the course of discussing #18078 (it does not fix #18078, which is an issue about something else).My main motivation to add this feature is that it's very easy to add and somewhat useful to me and others, who sometimes want to see what the effect of enabling all error codes is, whether we decide to check our code with that every time or just want to evaluate all of the codes at once to see which are worthwhile.
I don't think this PR closes further discussion on whether, eg, --strict should also enable every error code, which I also think should be true, but for other reasons; nor what flags should control what other error codes, which is also a fertile grounds for discussion. I conceptualize
--enable-error-codes all
as sort of a "low-level" command line option that does something simple to define (all), whereas other flags do something more ergonomic like give you some recommended set of error codes.This code change seems like it should allow not just command line usage but also configuration file usage, but for some opaque reason (perhaps my machine configuration is just cursed?) this did not work for me (it resulted in an "invalid error code" error message). So it's documented as only a command line feature.
The test for this feature spotchecks that
--enable-error-code all
enabledexplicit-override
and a couple other errors.