config

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config loads .gauntlet.yml. Zero-config by default — a missing file returns Config{} with no error; the caller substitutes engine defaults. Unknown YAML keys are hard errors (typo protection).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Disable lists gate names to skip entirely, even when the stack lists
	// them. Useful for repos that ship without golangci-lint intentionally.
	Disable []string `yaml:"disable"`
	// BaseRef overrides the default `--since` ref (main).
	BaseRef string `yaml:"base_ref"`
	// Gates configures per-gate overrides. Keys are gate names; values are
	// per-gate options (currently only `args`).
	Gates map[string]GateConfig `yaml:"gates"`
	// CustomGates plugs in ANY tool with machine-readable output. Keys are
	// gate names (must NOT collide with a built-in). Values describe how to
	// run the tool and which parser consumes its output.
	CustomGates map[string]CustomGate `yaml:"custom_gates"`
}

Config is the on-disk shape of .gauntlet.yml.

func Load

func Load(root string) (Config, error)

Load reads .gauntlet.yml from `root`. Missing file → zero Config, no error. Unknown keys → error naming the key (typo guard).

func (Config) IsDisabled

func (c Config) IsDisabled(name string) bool

IsDisabled reports whether a gate name appears in Config.Disable.

type CustomGate

type CustomGate struct {
	// Command is the argv to run (first element is the binary, resolved
	// via PATH).
	Command []string `yaml:"command"`
	// Pipeline is an ordered list of argv arrays. Stages are connected directly
	// stdout-to-stdin without invoking a shell. Mutually exclusive with Command.
	Pipeline [][]string `yaml:"pipeline"`
	// Parser selects the built-in parser kind:
	//   "json-findings"    — []{file, line, column, severity, rule, message}
	//   "file-line-col"    — Go/tsc-style `path:LINE[:COL]: msg` line format
	//   "exit-code-only"   — non-zero exit = single fatal finding, stderr as message
	//   "github-annotations" — GitHub workflow command annotations
	Parser string `yaml:"parser"`
	// LineScoped reports whether this gate's findings can be filtered by
	// diff scoping. Set false for whole-run gates (test/build kinds).
	LineScoped bool `yaml:"line_scoped"`
}

CustomGate wires a user-defined tool into the gate pipeline. All three parser kinds are built-in — no plugin binaries, no network, no SaaS.

type GateConfig

type GateConfig struct {
	Args []string `yaml:"args"`
}

GateConfig carries per-gate overrides. Extendable as gates gain knobs.

Jump to

Keyboard shortcuts

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