Skip to main content

checks.run_checks

checks.run_checks(spec, today=None)

Run every check: architecture, all units, all decisions, all archived runs.

Every run.toml under regen/runs/ is parsed once, for all units together; one that does not parse is reported once, as PROV10, at its own path.

Parameters

Name Type Description Default
spec RegenSpec The loaded spec. required
today date | None Reference date for review deadlines. Defaults to today. None

Returns

Name Type Description
list[Finding] list[Finding]: Errors first, then warnings. Within a level: the architecture, the units sorted by name, the decisions, the run records.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import load_spec, make_sample_repo, run_checks

with TemporaryDirectory() as tmp:
    root = make_sample_repo(Path(tmp) / "demo")
    spec = load_spec(root)
    print(len(run_checks(spec)), "findings")
    (root / "regen/units/core.calc.toml").unlink()
    print(len(run_checks(load_spec(root))), "findings without the unit")
0 findings
1 findings without the unit