If mypy fails it should report the error back to lintrunner (#145550)

This happened to me because I had a bad LD_LIBRARY_PATH and mypy was failing to run (.so load error) - but lintrunner was silent about the underlying problem.

Differential Revision: [D68593081](https://our.internmc.facebook.com/intern/diff/D68593081)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/145550
Approved by: https://github.com/bobrenjc93, https://github.com/Skylion007
This commit is contained in:
Aaron Orenstein 2025-01-23 21:40:53 -08:00 committed by PyTorch MergeBot
parent 7c314bfed4
commit 1335882b2a

View file

@ -149,6 +149,21 @@ def check_files(
]
stdout = str(proc.stdout, "utf-8").strip()
stderr = str(proc.stderr, "utf-8").strip()
if proc.returncode not in (0, 1):
return [
LintMessage(
path=None,
line=None,
char=None,
code=code,
severity=LintSeverity.ERROR,
name="command-failed",
original=None,
replacement=None,
description=stderr,
)
]
rc = [
LintMessage(
path=match["file"],