review.formats.load(path, kind)
Read a review file strictly.
Parameters
| path |
Path |
The file. |
required |
| kind |
str |
One of KINDS. |
required |
Returns
|
dict[str, object] |
dict[str, object]: The parsed file, format included. |
Raises
|
ConfigurationError |
If the file is missing or not TOML, has no format or another format number than FORMAT, or fails validate. |
Examples
from pathlib import Path
from tempfile import TemporaryDirectory
from babregen.review.formats import dump, load
data = {"run": "x", "checked_by": "fixture-rater", "proposal_sha256": "0" * 64,
"agrees": True, "category": "generator error", "comment": "ok"}
with TemporaryDirectory() as tmp:
path = Path(tmp) / "x.check.toml"
path.write_text(dump("proposal-check", data), encoding="utf-8")
print(load(path, "proposal-check")["agrees"])