Skip to content

Commit 1230ced

Browse files
authored
runtests: Run pre-commit only on specified files (#11949)
1 parent 55b5521 commit 1230ced

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/runtests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ def main() -> None:
7878
if folder not in {"stdlib", "stubs"}:
7979
parser.error("Only the 'stdlib' and 'stubs' folders are supported.")
8080
if not os.path.exists(path):
81-
parser.error(rf"'path' {path} does not exist.")
81+
parser.error(f"{path=} does not exist.")
8282
stubtest_result: subprocess.CompletedProcess[bytes] | None = None
8383
pytype_result: subprocess.CompletedProcess[bytes] | None = None
8484

8585
print("\nRunning pre-commit...")
86-
pre_commit_result = subprocess.run(["pre-commit", "run", "--all-files"])
86+
pre_commit_result = subprocess.run(["pre-commit", "run", "--files", *Path(path).rglob("*")])
8787

8888
print("\nRunning check_typeshed_structure.py...")
8989
check_structure_result = subprocess.run([sys.executable, "tests/check_typeshed_structure.py"])

0 commit comments

Comments
 (0)