Documentation
¶
Overview ¶
Package customgate implements a generic Gate that runs an arbitrary command and parses its output via a built-in parser kind. Users wire this in via .gauntlet.yml's `custom_gates:` map — no plugin binaries, no network, no SaaS. Any tool with machine-readable output becomes a gate.
Index ¶
- Constants
- func ParseExitCode(gate string, exitCode int, stderr []byte) []domain.Finding
- func ParseFileLineCol(gate string, raw []byte) ([]domain.Finding, error)
- func ParseGitHubAnnotations(gate string, raw []byte) ([]domain.Finding, error)
- func ParseJSONFindings(gate string, raw []byte) ([]domain.Finding, error)
- type Gate
Constants ¶
const ( ParserJSONFindings = "json-findings" ParserFileLineCol = "file-line-col" ParserExitCodeOnly = "exit-code-only" ParserGitHub = "github-annotations" )
ParserKind names the built-in parsers.
Variables ¶
This section is empty.
Functions ¶
func ParseExitCode ¶
ParseExitCode maps an exit code + stderr to a single Finding when the command failed. Zero exit = no findings. Used for tools without structured output (e.g. `terraform fmt -check`).
func ParseFileLineCol ¶
ParseFileLineCol reads stderr/stdout in the standard Go/tsc-style line format. Non-matching lines are skipped (progress noise / blank lines).
func ParseGitHubAnnotations ¶
ParseGitHubAnnotations reads GitHub workflow command annotations. Ordinary output is ignored so progress and summary lines can surround findings.
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
Gate implements gates.Gate for user-defined tools declared in `.gauntlet.yml`'s custom_gates map.
func New ¶
func New(name string, cfg config.CustomGate) (*Gate, error)
New constructs a Gate for the given name + config. Returns error if the config is malformed (unknown parser kind or invalid process definition).