(value: str)
| 41 | |
| 42 | |
| 43 | def load_record(value: str) -> dict[str, Any]: |
| 44 | record = maybe_load_json_record(value) |
| 45 | if record is not None: |
| 46 | return record |
| 47 | path = Path(value).expanduser() |
| 48 | if path.exists() and path.is_file(): |
| 49 | data = json.loads(path.read_text(encoding="utf-8")) |
| 50 | if isinstance(data, dict): |
| 51 | return data |
| 52 | raise SystemExit(f"Expected JSON object for {value!r}.") |
| 53 | |
| 54 | |
| 55 | def issue(code: str, severity: str = "error", **details: Any) -> dict[str, Any]: |
no test coverage detected