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

--disallow-incomplete-defs not emitting any output #8917

Closed
CraftSpider opened this issue May 29, 2020 · 3 comments
Closed

--disallow-incomplete-defs not emitting any output #8917

CraftSpider opened this issue May 29, 2020 · 3 comments

Comments

@CraftSpider
Copy link
Contributor

  • 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:

def incomplete(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)

--python-version 3.8 --strict-optional --no-site-packages --show-traceback --no-implicit-optional --disallow-any-generics --disallow-subclassing-any --disallow-incomplete-defs

@emmatyping
Copy link
Collaborator

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

@hauntsaninja
Copy link
Collaborator

I believe the issue is if you modify the typeshed's mypy_test to disallow incomplete defs, it doesn't seem to work. From

if show_untyped and (self.options.disallow_untyped_defs or check_incomplete_defs):
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.

@CraftSpider
Copy link
Contributor Author

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.

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

No branches or pull requests

3 participants