From 43ff4ea1f7ef82ff2818b20e56b60c6c15726d77 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Tue, 13 Mar 2018 20:00:49 +0000 Subject: [PATCH] tools: Ensure mypy is run on .pyi files. --- tools/run-mypy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/run-mypy b/tools/run-mypy index 4383c7de32..0048c2f4a0 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -78,10 +78,10 @@ files_dict = cast(Dict[str, List[str]], use_shebang=True, modified_only=args.modified, exclude=exclude, group_by_ftype=True, extless_only=args.scripts_only)) -pyi_files = set(files_dict['pyi']) +pyi_files = list(files_dict['pyi']) python_files = [fpath for fpath in files_dict['py'] if not fpath.endswith('.py') or fpath + 'i' not in pyi_files] -if not python_files: +if not python_files and not pyi_files: print("There are no files to run mypy on.") sys.exit(0) @@ -105,7 +105,7 @@ if args.ignore_missing_imports: if args.quick: extra_args.append("--quick") -rc = subprocess.call([mypy_command] + extra_args + python_files) +rc = subprocess.call([mypy_command] + extra_args + python_files + pyi_files) if args.linecoverage_report: # Move the coverage report to where codecov will look for it.