-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcheck_readme_regressions.py
More file actions
executable file
·52 lines (45 loc) · 1.42 KB
/
check_readme_regressions.py
File metadata and controls
executable file
·52 lines (45 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
from __future__ import annotations
import pathlib
import re
import sys
README_PATH = pathlib.Path("README.md")
README_TEXT = README_PATH.read_text(encoding="utf-8")
CHECKS: list[tuple[str, str]] = [
(
"TSS version FAQ note",
r"TSS version alone does \*\*not\*\* tell you whether a vehicle has TSK/SecOC",
),
(
"EU vs US RAV4 FAQ note",
r"EU 2024 RAV4 Hybrid appears to have TSK, while the US 2025 RAV4 appears not to have TSK",
),
(
"openpilot freshness badge",
r"img\.shields\.io/github/last-commit/commaai/openpilot/nightly-dev",
),
(
"sunnypilot release-tizi freshness badge",
r"img\.shields\.io/github/last-commit/sunnypilot/sunnypilot/release-tizi",
),
(
"FrogPilot freshness badge",
r"img\.shields\.io/github/last-commit/FrogAi/FrogPilot/FrogPilot",
),
(
"SatoPilot personal3 freshness badge",
r"img\.shields\.io/github/last-commit/AlexandreSato/openpilot/personal3",
),
]
def main() -> int:
failed = False
for label, pattern in CHECKS:
if re.search(pattern, README_TEXT, flags=re.MULTILINE) is None:
failed = True
print(f"Missing expected README content: {label}", file=sys.stderr)
if failed:
return 1
print("README regression checks passed.")
return 0
if __name__ == "__main__":
raise SystemExit(main())