|
| int | save_baseline (list[dict] results, Path baseline_path, str profile) |
| LintBaseline|None | load_baseline (Path baseline_path) |
| tuple[list[tuple[str, str, str]], list[tuple[str, str, str]]] | diff_against_baseline (list[dict] results, LintBaseline baseline) |
| list[tuple[str, str, str]] | blocking_violations (list[tuple[str, str, str]] violations, list[dict] results) |
Purpose
-------
FS-508 - lint baseline: snapshot current violations so subsequent runs
can report only new vs resolved issues.
Responsibilities
----------------
- Save a baseline from lint results to ``.option_c/cache/lint-baseline.json``.
- Load an existing baseline from disk.
- Diff current results against a baseline to find new and resolved violations.
- Pick the blocking ones out of the new violations; only they fail
``--against-baseline`` (operator ruling 2026-09-28).
Diagnostics
-----------
Domain: OCT-LINTER
Levels:
L2 - (none) the save, load and diff are reported at L3
L3 - baseline save/load/diff
L4 - (none)
Contracts
---------
- Baseline file is JSON with ``_schema_version``, ``entries``, metadata.
- Corrupt or missing file returns ``None`` (no crash).
- Violations are keyed by ``(path, rule)`` for diff stability.
Dependencies
------------
- oct (__version__, recorded in the baseline)
- oct.core.diagnostics (_dbg structured logger)
- oct.linter.rule_registry (SEVERITY_BLOCKING)
| tuple[list[tuple[str, str, str]], list[tuple[str, str, str]]] oct.linter.lint_baseline.diff_against_baseline |
( |
list[dict] | results, |
|
|
LintBaseline | baseline ) |
Compare current *results* against *baseline*.
Returns ``(new_violations, resolved_violations)`` where each item is
``(path, rule, message)``.
A violation is identified by its ``(path, rule)`` pair. If a
``(path, rule)`` appears in current results but not in the baseline,
it is "new". If it appears in the baseline but not in current results,
it is "resolved".
Definition at line 149 of file lint_baseline.py.