-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add flag to raise error if match statement does not match exaustively #19144
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
|
This comment has been minimized.
This comment has been minimized.
Add flag to primer as asked in PR
I added where it looked like made sense to pass the arg to mypy_primer (workflow files?), let me know if I misunderstood where to pass this. I'll have a look at the error code option when I have a chance and see how it feels. Should still be possible to enable discovery, but right now at least I think CLI mention in |
Sorry I meant specifically just default to enabled for a commit and let mypy primer run. Anyways, this should already work for an error code, I just don't know how to disable them by default. (The fact it would be a smaller change is why I said it would be neater) |
This comment has been minimized.
This comment has been minimized.
This reverts commit 3341b4b.
There appears to be a parsing issue in sphyx? For the lines with `match val: # error: ...` the `: # error:` part is being interpreted as a directive I think? Means the # is stripped from the python code and the docs can't build
This comment has been minimized.
This comment has been minimized.
Requested in PR
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CI run with default set to |
This reverts commit 0f9ed6a.
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. ✅ |
Test passing now. My preference is for the CLI arg for discoverability in cli help etc. |
Fixes #19136
Change is to add a mode to catch when a match statement is not handling all cases exhaustively, similar to what pyright does by default.
After discussion on #19136 I put it behind a new flag that is not enabled by default.
I updated docs to include information on the new flag also.
Please let me know if anything is not following standards, in particular I wasn't sure what to name this new flag to be descriptive while following existing flag naming style.