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
{{ message }}
Repository navigation
--disallow-incomplete-defs not emitting any output #8917
Are you reporting a bug, or opening a feature request?
Reporting a bug
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
The typeshed repo mypy_test. Minimal example:
defincomplete(a) ->None: ...
What is the actual behavior/output?
Success: no issues found in 982 source files
What is the behavior/output you expect?
A very large number of errors, I can see many instances in just one file
What are the versions of mypy and Python you are using?
3.8, latest master
What are the mypy flags you are using? (For example --strict-optional)
Hi, if I run the code you gave it gives the expected:
main.py:1: error: Function is missing a type annotation for one or more arguments
Also the typeshed tests seem not to use --disallow-incomplete-defs, so I am a bit confused about your issue. Perhaps this would be better solved on gitter? https://gitter.im/python/typing
it looks like you need to pass --warn-incomplete-stub as well. This works for me locally; tkinter is pretty bad, but apart from that there are only about 60 errors in stdlib that apply to py3.
Also, it looks like --disallow-untyped-defs is actually a little stricter than --disallow-incomplete-defs, which is maybe not what I expected given the name.
Ah, thank you, that was what I was missing. And yes, the issue was with modifying the flags. Looking at the documentation, --warn-incomplete-stub is specifically designed for allowing the flag to work on typeshed, so I'll close this, as there's no issue.
Activity
emmatyping commentedon May 29, 2020
Hi, if I run the code you gave it gives the expected:
Also the typeshed tests seem not to use
--disallow-incomplete-defs, so I am a bit confused about your issue. Perhaps this would be better solved on gitter? https://gitter.im/python/typinghauntsaninja commentedon May 29, 2020
I believe the issue is if you modify the typeshed's mypy_test to disallow incomplete defs, it doesn't seem to work. From
mypy/mypy/checker.py
Line 1050 in 273a865
--warn-incomplete-stubas well. This works for me locally; tkinter is pretty bad, but apart from that there are only about 60 errors in stdlib that apply to py3.Also, it looks like
--disallow-untyped-defsis actually a little stricter than--disallow-incomplete-defs, which is maybe not what I expected given the name.CraftSpider commentedon May 29, 2020
Ah, thank you, that was what I was missing. And yes, the issue was with modifying the flags. Looking at the documentation,
--warn-incomplete-stubis specifically designed for allowing the flag to work on typeshed, so I'll close this, as there's no issue.