Skip to content

Commit 69ad29f

Browse files
aero31aeroshowell
authored andcommitted
tools: Allow force including files for mypy.
1 parent b157b81 commit 69ad29f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/run-mypy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ exclude = [
3232
"tools/test-lib",
3333
]
3434

35+
# These files will be included even if excluded by a rule above.
36+
force_include = [
37+
# Include bots that we migrate to mypy.
38+
"zulip_bots/zulip_bots/bots/helloworld/helloworld.py",
39+
]
40+
3541
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")
3642
parser.add_argument('targets', nargs='*', default=[],
3743
help="""files and directories to include in the result.
@@ -63,6 +69,11 @@ files_dict = cast(Dict[str, List[str]],
6369
use_shebang=True, modified_only=args.modified,
6470
exclude = exclude + ['stubs'], group_by_ftype=True,
6571
extless_only=args.scripts_only))
72+
73+
for inpath in force_include:
74+
ext = os.path.splitext(inpath)[1].split('.')[1]
75+
files_dict[ext].append(inpath)
76+
6677
pyi_files = set(files_dict['pyi'])
6778
python_files = [fpath for fpath in files_dict['py']
6879
if not fpath.endswith('.py') or fpath + 'i' not in pyi_files]

0 commit comments

Comments
 (0)