config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config is the .kibble.yml schema: what a repository may tell kibble about documentation its heuristics cannot read on their own.

It is a leaf on purpose. A repository describes fixtures, environment and rules without knowing how any of them will be planned or run, and keeping the schema below the planner is what stops "the config says so" from becoming a way to reach back into the engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExamplesConfig

type ExamplesConfig struct {
	// Disable turns example checks off for the repo.
	Disable bool `yaml:"disable"`
	// Packages are extra Debian packages the session installs.
	Packages []string `yaml:"packages"`
	// Env is extra environment exported for the whole session.
	Env map[string]string `yaml:"env"`
	// Fixtures are files written into the workdir before any step runs.
	Fixtures []Fixture `yaml:"fixtures"`
	// Substitutions rewrite documented text before planning, keyed by the
	// exact text to replace.
	Substitutions map[string]string `yaml:"substitutions"`
	// Steps are per-line rules matched by substring.
	Steps []StepRule `yaml:"steps"`
	// Docs are extra documents to replay, as paths relative to the repository
	// root, for instructions the naming convention does not pick up.
	Docs []string `yaml:"docs"`
	// SkipDocs are documents the convention picks up that should not run.
	SkipDocs []string `yaml:"skipDocs"`
}

ExamplesConfig is a repo owner's overrides for example planning. The planner's heuristics decide everything on their own; this file settles the calls they cannot make, such as fixtures with meaningful contents or a step that is expected to exit nonzero.

func LoadExamplesConfig

func LoadExamplesConfig(dir string) (*ExamplesConfig, error)

LoadExamplesConfig reads .kibble.yml from a repo directory. A missing file returns nil config and no error; a malformed file returns the error so the run can name it rather than silently ignoring the owner's intent.

type Fixture

type Fixture struct {
	// Path is the file path, relative to the session workdir.
	Path string `json:"path" yaml:"path"`
	// Contents is the file body.
	Contents string `json:"contents" yaml:"contents"`
}

Fixture is a file the executor writes into the session workdir.

type StepRule

type StepRule struct {
	// Binary selects lines that invoke this documented binary.
	Binary string `yaml:"binary"`
	// Subcommand selects lines whose first subcommand is exactly this. It
	// pairs with Binary and is ignored without one, since a subcommand name
	// on its own belongs to no particular tool.
	Subcommand string `yaml:"subcommand"`
	// Match selects lines containing this text as a run of whole words, so
	// `tool run` does not select `tool run-production`. It is the escape
	// hatch for what Binary and Subcommand cannot say; prefer those.
	Match string `yaml:"match"`
	// Run forces a line to run even when the planner would skip it.
	Run bool `yaml:"run"`
	// Skip skips the line with this reason.
	Skip string `yaml:"skip"`
	// NonzeroOK accepts a nonzero exit as documented behavior.
	NonzeroOK bool `yaml:"nonzeroOk"`
	// Background runs the containing step behind the session.
	Background bool `yaml:"background"`
	// ReadyLog is output that marks the background step ready.
	ReadyLog string `yaml:"readyLog"`
}

StepRule overrides the planner's judgment for the lines it selects. A rule must carry at least one selector, and the structured ones are preferred: Binary and Subcommand say what a line invokes, which is what the author means, while Match compares text and can only approximate it.

Jump to

Keyboard shortcuts

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