Enable some more mypy lints when checking our own code (#9787)

This commit is contained in:
Alex Waygood
2023-02-21 00:54:35 +00:00
committed by GitHub
parent bc847a9b07
commit 880c0da404

View File

@@ -57,15 +57,18 @@ def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> Retur
"--no-error-summary",
"--enable-error-code",
"ignore-without-code",
"--enable-error-code",
"possibly-undefined",
"--enable-error-code",
"redundant-expr",
]
if directory == "tests" and platform == "win32":
command.extend(["--exclude", "tests/pytype_test.py"])
result = subprocess.run(command, capture_output=True)
stdout, stderr = result.stdout, result.stderr
if stderr:
print_error(stderr.decode())
if stdout:
print_error(stdout.decode())
result = subprocess.run(command, capture_output=True, text=True)
if result.stderr:
print_error(result.stderr)
if result.stdout:
print_error(result.stdout)
return result.returncode