Skip to content

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

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

JelleZijlstra
Copy link
Member

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.

@@ -7,7 +7,6 @@ no_implicit_optional = True
disallow_any_generics = True
disallow_any_unimported = True
warn_redundant_casts = True
warn_unused_ignores = True
Copy link
Member

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>

Copy link
Member Author

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: ignores in mypy itself unused, and that leads to test failures in typeshed.

Copy link
Member

@gvanrossum gvanrossum left a 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.

@emmatyping
Copy link
Member

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?

@gvanrossum
Copy link
Member

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.

@emmatyping
Copy link
Member

Ah, I suppose I was optimistically hoping there could be a script that would write to that location, but perhaps that isn't possible.

Copy link
Member

@emmatyping emmatyping left a 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.

@gvanrossum gvanrossum merged commit 6e8dfd5 into python:master Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants