Documentation
¶
Overview ¶
Package invariants checks that each Implemented ADR's `inv: <slug>` invariant tag is backed by a `<marker> invariant: <slug>` comment in a configured source file. The comment marker and the files scanned are language-configurable via the project's invariants config; nothing here assumes Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeclaredSlugs ¶ added in v0.16.0
DeclaredSlugs returns the invariant slugs declared via `inv: <slug>` bullets in an ADR Invariants-section body, in source order.
func MarkersUnder ¶ added in v0.16.0
MarkersUnder returns the sorted, unique invariant slugs whose backing marker comment lies in a file that both matches a source glob and sits under one of paths (a queried path P owns file F when F == P or F is prefixed by P+"/"). paths are slash-separated repo-relative paths. It reads only source files and writes nothing.
Types ¶
type Finding ¶
Finding is an Implemented-ADR invariant slug that is not satisfied.
func Check ¶
func Check(decisionsDir, root string, cfg *config.InvariantConfig) ([]Finding, error)
Check returns a Finding per unsatisfied Implemented-ADR invariant slug. No required slugs → nil. cfg disabled → nil. cfg nil or source-less → every required slug is Unchecked. Otherwise unbacked slugs are Unbacked.