docs: scaffold polisher-control foundation
This commit is contained in:
11
scripts/print_tree.py
Normal file
11
scripts/print_tree.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
for path in sorted(ROOT.rglob("*")):
|
||||
if ".git" in path.parts or "__pycache__" in path.parts:
|
||||
continue
|
||||
rel = path.relative_to(ROOT)
|
||||
if len(rel.parts) > 4:
|
||||
continue
|
||||
print(rel)
|
||||
27
scripts/validate_json.py
Normal file
27
scripts/validate_json.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
errors = 0
|
||||
for path in sorted(ROOT.rglob("*.json")):
|
||||
if ".git" in path.parts:
|
||||
continue
|
||||
try:
|
||||
json.loads(path.read_text(encoding="utf-8"))
|
||||
except Exception as exc:
|
||||
print(f"JSON ERROR {path.relative_to(ROOT)}: {exc}")
|
||||
errors += 1
|
||||
if errors:
|
||||
return 1
|
||||
print("OK: all JSON files parse")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user