remove warn_unused_ignores from mypy_self_check#4817
remove warn_unused_ignores from mypy_self_check#4817gvanrossum merged 1 commit intopython:masterfrom
Conversation
| disallow_any_generics = True | ||
| disallow_any_unimported = True | ||
| warn_redundant_casts = True | ||
| warn_unused_ignores = True |
There was a problem hiding this comment.
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.
I actually don't want it for mypy itself—the problems with the linked typeshed PRs are that they make # type: ignores in mypy itself unused, and that leads to test failures in typeshed.
|
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. |
emmatyping
left a comment
There was a problem hiding this comment.
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.