Skip to content

Commit

Permalink
tools: Include test_run.py under files to be type-checked with mypy.
Browse files Browse the repository at this point in the history
This commit adds a new "tests" key to the `repo_python_files` dict to
let mypy know which files to type check. A new list,
`type_consistent_testfiles` is also added, to hold the list of test
files that have been type-annotated incrementally till all the test
files are consistent.
  • Loading branch information
prah23 authored and neiljp committed Jul 11, 2021
1 parent 159c2ba commit 2ec67b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/run-mypy
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,18 @@ python_files = [fpath for fpath in files_dict['py']

repo_python_files = {}
repo_python_files['zulipterminal'] = []
repo_python_files['tests'] = []

# Added incrementally as newer test files are type-annotated.
type_consistent_testfiles = ["test_run.py"]

for file_path in python_files:
repo = PurePath(file_path).parts[0]
if repo in repo_python_files:
filename = PurePath(file_path).parts[-1]
if (
repo == "zulipterminal" or
(repo == 'tests' and filename in type_consistent_testfiles)
):
repo_python_files[repo].append(file_path)

mypy_command = "mypy"
Expand Down

0 comments on commit 2ec67b0

Please sign in to comment.