From 1230ced06692c2a23a909f441238f5df0c73b6fb Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 18 May 2024 09:07:42 -0400 Subject: [PATCH] `runtests`: Run pre-commit only on specified files (#11949) --- tests/runtests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/runtests.py b/tests/runtests.py index 2a4f445af12e..69731265995b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -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"])