Documentation
¶
Overview ¶
Package census holds the shape and the shrink-only bookkeeping every rule-corpus census shares.
Two censuses — formwork-universal-cure-census and formwork-anchor-census — ask different questions of .formwork/rules/*.yaml and then do the IDENTICAL thing with the answer: key each flagged arm as FILE:ARM-ID, reconcile that against a per-arm known-debt list, and fail on a new offender OR on a stale entry. Detection is the part that differs and stays in each tool; this is the part that does not.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadDebtList ¶
ReadDebtList loads a known-debt allowlist: one FILE:ARM-ID key per line, `#` comments and blanks ignored.
A missing file is returned as an error, never as an empty set: deleting the allowlist would otherwise read as "no debt" and silently pass every arm that was being carried.
func Reconcile ¶
Reconcile writes the verdict for one census run and returns the problem count: new offenders plus stale entries. why is the one-line explanation appended to each NEW report, so the failing arm carries its reason without the caller re-templating the whole line.
A zero return is the only pass. Carried debt is printed but not counted; a stale entry IS counted, which is what makes the list shrink-only.
Types ¶
type Finding ¶
Finding is one flagged rule arm: the repo-relative rule file, the 1-based line the verdict anchors to, and the arm's id for the report.
func (Finding) Key ¶
Key is the known-debt key for a finding.
Per ARM, not per FILE. A file-keyed list waves through a NEW offending arm added to any listed file, which is the hole the ratchets exist to close; it also leaves an entry live after one arm of a two-arm file is cured, so nothing forces the entry out.