Skip to content
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

Warn on module level type ignore with error code #13512

Merged
merged 4 commits into from Aug 26, 2022

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Aug 25, 2022

Per-module error codes were added in #13502, let's recommend using them.

The existing type ignore behaviour is pretty unintuitive; I think most
people actually want # mypy: ignore-errors. There are probably people
depending on the current behaviour of # type: ignore though.

Fixes #13435, fixes #12076, fixes #11999, fixes #11027, fixes #9318,
fixes #7839

Per-module error codes were added in python#13502, let's recommend using them.

The existing type ignore behaviour is pretty unintuitive; I think most
people actually want `# mypy: ignore-errors`. There are probably people
depending on the current behaviour though.

Fixes python#13435, fixes python#12076, fixes python#11999, fixes python#11027, fixes python#9318,
fixes python#7839
@github-actions

This comment has been minimized.

3 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit da56c97 into python:master Aug 26, 2022
@hauntsaninja hauntsaninja deleted the ignore-err branch August 26, 2022 19:28
LarsMichelsen pushed a commit to Checkmk/checkmk that referenced this pull request Nov 9, 2022
mypy 0.990 contains the change python/mypy#13512, so
we are forced to use the latest & greatest way of specifying module-level
typing suppressions now.  Note that it is not possible to split these fixed
from the mypy update itself: Previous versions don't understand the new way
and the current version complains about the old way.  Great upgrade path!
:-/

Change-Id: I2c54bcfd65729967f0beb4a8aebe367ffb2744c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment