Skip to content

Commit cc70773

Browse files
committed
mypy: No longer ignore missing import and checks all files in one go
1 parent da8d614 commit cc70773

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/run_py_linters.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@
4444
mypy_cache_dir = build_dir / '.mypy_cache'
4545

4646

47-
def run_mypy(path: Path) -> None:
48-
print(f"Running mypy on {path}")
47+
def run_mypy() -> None:
48+
print('Running mypy on all modules')
4949
run(
5050
args=(
5151
'mypy', '--strict',
5252
'--cache-dir', mypy_cache_dir,
5353
'--python-version', '3.8',
5454
'--namespace-packages',
55-
'--ignore-missing-imports',
56-
path,
55+
'--explicit-package-bases',
56+
*all_python_modules,
5757
),
5858
check=True,
5959
env={'MYPYPATH': str(src_dir.absolute()), **environ},
@@ -69,8 +69,7 @@ def linter_main() -> None:
6969
check=True,
7070
)
7171

72-
for x in all_python_modules:
73-
run_mypy(x)
72+
run_mypy()
7473

7574

7675
def get_all_python_files() -> List[Path]:

0 commit comments

Comments
 (0)