Skip to content

Commit ba5b0c4

Browse files
committed
Test the hooks files one at a time, as mypy is silly
1 parent b5953f7 commit ba5b0c4

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

hooks/pre-commit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22

3-
import re
43
import subprocess
54
import sys
65

static_tests.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22

3+
import os.path
34
import subprocess
45
import sys
56
from typing import List
@@ -15,11 +16,22 @@ def run(command: List[str]) -> None:
1516
exitcode = 1
1617

1718

18-
run(["flake8", "."])
19-
run([
20-
"mypy",
21-
"--strict",
22-
"--ignore-missing-imports",
23-
"."])
19+
extra_files = [
20+
os.path.join('hooks', 'pre-commit'),
21+
os.path.join('hooks', 'pre-push')
22+
]
23+
24+
run(["flake8", "."] + extra_files)
25+
26+
mypy_cmd = [
27+
"mypy",
28+
"--strict",
29+
"--ignore-missing-imports"
30+
]
31+
32+
run(mypy_cmd + ['.'])
33+
34+
for extra_file in extra_files:
35+
run(mypy_cmd + [extra_file])
2436

2537
sys.exit(exitcode)

0 commit comments

Comments
 (0)