Load section definitions from JSON file.
(path: str | Path | None)
| 328 | |
| 329 | |
| 330 | def load_sections(path: str | Path | None) -> list: |
| 331 | """Load section definitions from JSON file.""" |
| 332 | data = read_json(path, default=[]) |
| 333 | if isinstance(data, dict) and isinstance(data.get("sections"), list): |
| 334 | data = data["sections"] |
| 335 | if not isinstance(data, list): |
| 336 | raise SystemExit(f"ERROR: sections file must contain a JSON array: {path}") |
| 337 | return data |
| 338 | |
| 339 | |
| 340 | def load_report(path: str | Path | None) -> str: |
no test coverage detected