-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
remove warn_unused_ignores from mypy_self_check #4817
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
Conversation
@@ -7,7 +7,6 @@ no_implicit_optional = True | |||
disallow_any_generics = True | |||
disallow_any_unimported = True | |||
warn_redundant_casts = True | |||
warn_unused_ignores = True |
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.
We want this for mypy itself though. Can you add it back as a package-specific option?
[mypy-mypy.*]
<blah>
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.
I actually don't want it for mypy itself—the problems with the linked typeshed PRs are that they make # type: ignore
s in mypy itself unused, and that leads to test failures in typeshed.
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.
OK, that makes sense.
Would a better solution perhaps be #4815 once implemented? That way typeshed can have its own config that disables this, while mypy itself can check that we don't get unused ignores? |
IIUC #4815 would look for ~/.mypy.ini -- I don't see how typeshed could have its own. There's a different feature request that would allow multiple mypy.ini files all over a tree, and that would work. |
Ah, I suppose I was optimistically hoping there could be a script that would write to that location, but perhaps that isn't possible. |
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.
Until there is a better way to disable this just for typeshed, LGTM.
This check causes CI failures for typeshed PRs that fix unused ignores, such as python/typeshed#1982, python/typeshed#1881 and python/typeshed#1937. Currently, merging such PRs without leaving CI broken requires a complicated dance of merging into typeshed, syncing typeshed into mypy, and removing the ignores here. Removing the config option removes the need for coordinated changes in the mypy and typeshed repos, at the cost of perhaps leaving some stray type: ignores in the mypy codebase.