specdrift

package
v0.1.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const WorkLogPath = "spec/18_WORK_LOG.md"

Variables

This section is empty.

Functions

func PrintReport added in v0.1.1

func PrintReport(stdout, stderr io.Writer, report Report, advisory bool) (exitNonZero bool)

PrintReport renders report for CLI output and reports whether the caller should exit non-zero. The analysis behind report is identical regardless of advisory; advisory only changes how findings are presented, since fork PR contributors aren't expected to close out spec/work-log bookkeeping themselves — the maintainer does that at merge (AD-8).

Strict mode (advisory false) is byte-identical to the pre-advisory behavior: a passing report prints a one-line summary to stdout, and a failing report prints "spec drift check failed:" plus each finding to stderr and asks the caller to exit 1.

Advisory mode never asks for a non-zero exit. A passing report prints the same one-line summary. A report with findings prints one GitHub Actions "::warning::" annotation per finding to stdout, so each finding surfaces in the Actions UI, followed by the same human-readable finding list.

Types

type Options

type Options struct {
	RepoRoot       string
	Base           string
	Head           string
	ChangedFiles   []string
	RequireWorkLog bool
}

type Report

type Report struct {
	Specs        []Spec
	ChangedFiles []string
	Findings     []string
}

func Check

func Check(ctx context.Context, opts Options) (Report, error)

func (Report) OK

func (r Report) OK() bool

type Spec

type Spec struct {
	Path         string
	LastReviewed string
	TracksCode   []string
}

func LoadSpecs

func LoadSpecs(root string) ([]Spec, []string, error)

Jump to

Keyboard shortcuts

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