forked from aws-deadline/deadline-cloud-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate_repository.py
More file actions
38 lines (31 loc) · 900 Bytes
/
Copy pathvalidate_repository.py
File metadata and controls
38 lines (31 loc) · 900 Bytes
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
#!/usr/bin/env python3
"""Run all repository-wide static validation."""
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
CHECKS = (
(
"unit tests",
sys.executable,
"-m",
"unittest",
"discover",
"-s",
str(REPOSITORY_ROOT / "scripts" / "tests"),
"-p",
"test_*.py",
),
("Markdown links", sys.executable, str(REPOSITORY_ROOT / "scripts" / "check_markdown_links.py")),
)
def main() -> int:
for label, *command in CHECKS:
print(f"==> {label}", flush=True)
result = subprocess.run(command, cwd=REPOSITORY_ROOT, check=False)
if result.returncode:
return result.returncode
print("Repository validation passed")
return 0
if __name__ == "__main__":
raise SystemExit(main())