invariants

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 9 Imported by: 0

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

This section is empty.

Types

type Finding

type Finding struct {
	Slug   string
	ADR    string // filename of the declaring ADR
	Status Status
}

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.

func (Finding) Detail

func (f Finding) Detail() string

Detail is a human, language-neutral remedy line for the finding.

func (Finding) Line

func (f Finding) Line() string

Line renders the finding as a single human-readable line (no leading indent/column), shared by `awf check` and `awf invariants`.

type Status

type Status string

Status classifies an invariant finding.

const (
	Unbacked  Status = "unbacked"  // configured, but no backing tag found
	Unchecked Status = "unchecked" // no invariant sources configured (and not disabled)
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL