Documentation
¶
Overview ¶
Package lint — auto-lint guardrails after Edit/Write (ADR-014 T2, design from the 2026-04-26 multi-CLI fan-out).
One Runner exposes a single Lint(ctx, path) method that picks the right adapter by file extension, shells out to the upstream linter, parses its JSON output, and returns structured findings. Edit / Write call the runner immediately after a successful atomic write so findings ride back in the same response — agents self-correct in the next turn without an async queue.
Per ADR-007: every adapter wraps a maintained linter (golangci-lint, eslint, ruff). Adding a language is one new file, zero changes to the runner contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("lint: unsupported language")
ErrUnsupported is reserved for future use; currently Lint returns nil/nil for unsupported extensions rather than erroring (graceful skip per the spec). Kept exported in case a stricter mode wants it.
Functions ¶
Types ¶
type Finding ¶
type Finding struct {
LineNumber int `json:"line_number"`
Column int `json:"column"`
Severity string `json:"severity"` // "error" | "warning" | "info"
Tool string `json:"tool"` // golangci-lint | eslint | ruff
Message string `json:"message"`
}
Finding is one issue the linter reported. Same shape across every language so callers never branch on the linter that produced it.
type Runner ¶
Runner walks a single file path through the language adapter that matches its extension. Implementations must be safe to call concurrently from many Edit/Write invocations.