-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Deduplicate error codes for ignore-without-code
#12194
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
Deduplicate error codes for ignore-without-code
#12194
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Thanks!
Separately, I found
"type: ignore" comment without error code (currently ignored: [arg-type, union-attr])
just a little confusing. Maybe something like:
"type: ignore" comment without error code (use "type: ignore[arg-type, union-attr]" instead)
is clearer?
Think that would make sense. I could update this PR tomorrow or open a new one. |
This comment has been minimized.
This comment has been minimized.
Let's just update this one :-) |
7319126
to
02aa0c3
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Thank you! |
For context: it was intentional not to have the error message just tell you to update the |
It's a good point. Although from my test updating 100+ ignores, it wasn't all that practical tbh. It's a rather large codebase with only partial annotated code. The main benefit I see with it is not ignoring any new type errors that might come up once you start adding more annotations. That's just my opinion though. If there is a desire to revert it, I wouldn't oppose it. |
Do you feel the following captures the spirit of the original better? |
Opened a followup PR: #12216 |
Description
#11633 added the awesome
ignore-without-code
option. During testing I noticed that in some cases an error code would be displayed multiple times. This can be rather annoying, since it's only necessary to ignore an error code once./CC: @PeterJCLaw
Test Plan
Added a new test case.