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
Hi! This is expected behavior. The exclude option controls how mypy discovers files to type check (you can think of it as refining the "entry points" for type checking). However it doesn't affect the way that the discovered files are type checked. In particular, it doesn't affect the way mypy follow imports. If any of the files being analyzed import a module from libs, then by default that module will be analyzed as well (along with any modules that it imports). You can refer to Following Imports from the mypy docs for more details on how this works and what configuration options are available.
If you want to suppress errors for modules from libs, you can try setting follow_imports to silent for those modules:
Bug Report
I want to exclude a folder from mypy checks, but it still inspect it.
mypy -v output:
To Reproduce
git clone [email protected]:artsiomkaltovich/mypy_exclude.git
mypy .
Expected Behavior
libs folder is excluded
Actual Behavior
libs/lib1/lib1.py:2: error: Incompatible return value type (got "int", expected "str") [return-value]
Your Environment
Refer to pyproject.toml file.
The text was updated successfully, but these errors were encountered: