runtests: Run pre-commit only on specified files (#11949)

This commit is contained in:
Avasam
2024-05-18 09:07:42 -04:00
committed by GitHub
parent 55b552121b
commit 1230ced066

View File

@@ -78,12 +78,12 @@ def main() -> None:
if folder not in {"stdlib", "stubs"}:
parser.error("Only the 'stdlib' and 'stubs' folders are supported.")
if not os.path.exists(path):
parser.error(rf"'path' {path} does not exist.")
parser.error(f"{path=} does not exist.")
stubtest_result: subprocess.CompletedProcess[bytes] | None = None
pytype_result: subprocess.CompletedProcess[bytes] | None = None
print("\nRunning pre-commit...")
pre_commit_result = subprocess.run(["pre-commit", "run", "--all-files"])
pre_commit_result = subprocess.run(["pre-commit", "run", "--files", *Path(path).rglob("*")])
print("\nRunning check_typeshed_structure.py...")
check_structure_result = subprocess.run([sys.executable, "tests/check_typeshed_structure.py"])