You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type ignore comments erroneously marked as unused by dmypy (#15043)
There is currently a misbehaviour where "type: ignore" comments are
erroneously marked as unused in re-runs of dmypy. There are also cases
where errors disappear on the re-run.
As far as I can tell, this only happens in modules which contain an
import that we don't know how to type (such as a module which does not
exist), and a submodule which is unused.
There was a lot of commenting and investigation on this PR, but I hope
that the committed tests and fixes illustrate and address the issue.
Related to #9655
---------
Co-authored-by: David Seddon <[email protected]>
Co-authored-by: Shantanu <[email protected]>
Co-authored-by: Ivan Levkivskyi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
foo.py:2: error: Cannot find implementation or library stub for module named "a_module_which_does_not_exist" [import-not-found]
749
+
foo.py:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
750
+
== Return code: 1
751
+
$ dmypy check -- foo.py
752
+
foo.py:2: error: Cannot find implementation or library stub for module named "a_module_which_does_not_exist" [import-not-found]
753
+
foo.py:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
foo.py:3: error: Cannot find implementation or library stub for module named "a_module_which_does_not_exist" [import-not-found]
769
+
foo.py:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
770
+
== Return code: 1
771
+
$ dmypy check -- foo.py
772
+
foo.py:3: error: Cannot find implementation or library stub for module named "a_module_which_does_not_exist" [import-not-found]
773
+
foo.py:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
0 commit comments