Deduplicate error codes for ignore-without-code#12194
Conversation
This comment has been minimized.
This comment has been minimized.
hauntsaninja
left a comment
There was a problem hiding this comment.
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-codeoption. 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.