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 does not print errors when run without this argument previously #4913
Running it with --disallow-incomplete-defs or --disallow-untyped-defs still produces lots of warnings.
Since upgrading to mypy 0.590, running mypy, followed by mypy --disallow-incomplete-defs will not output any warnings, although the latter command should produce loads. mypy --disallow-untyped-defs on the other hand still works. When running mypy --disallow-incomplete-defs after removing .mypy_cache or after mypy --disallow-untyped-defs, it will again print the warnings, until the next time mypy is run without arguments. --no-incremental also works around this problem.
I tried to create a minimal test case with just one file exhibiting that problem, but unfortunately that worked correctly.
This is likely caused by the switch to incremental mode by default (may be a problem with import cycles). As a temporary workaround you can use --no-incremental on 0.590, but since this is a regression, I think this is high priority to fix.
srittau@moby:~$ mkdir mypy-bug && cd mypy-bug
srittau@moby:~/mypy-bug$ mkdir -p pylibs/mypkg
srittau@moby:~/mypy-bug$ cat > pylibs/mypkg/__init__.py
def func(foo) -> bool:
return False
srittau@moby:~/mypy-bug$ mypy --disallow-incomplete-defs pylibs
pylibs/mypkg/__init__.py:1: error: Function is missing a type annotation for one or more arguments
srittau@moby:~/mypy-bug$ mypy pylibs
srittau@moby:~/mypy-bug$ mypy --disallow-incomplete-defs pylibs
srittau@moby:~/mypy-bug$
Activity
ilevkivskyi commentedon Apr 15, 2018
This is likely caused by the switch to incremental mode by default (may be a problem with import cycles). As a temporary workaround you can use
--no-incrementalon 0.590, but since this is a regression, I think this is high priority to fix.srittau commentedon Apr 15, 2018
I managed to produce a minimal test case:
gvanrossum commentedon Apr 15, 2018
I'm guessing that
disallow_incomplete_defsshould be included in the setPER_MODULE_OPTIONSin mypy/options.py.gvanrossum commentedon Aug 29, 2018
Maybe this was fixed by #5414? My suggestion was implemented there.
srittau commentedon Aug 29, 2018
I'll check when I get home.
srittau commentedon Aug 29, 2018
This bug is reproducible with mypy 0.620, but not with mypy HEAD. Closing.