Documentation
¶
Overview ¶
Package config loads and writes the committed skeeper project config.
Index ¶
Constants ¶
const ( // Filename is the committed project config file. Filename = ".skeeper.yml" // NamespaceBranchSegment separates a sidecar namespace from branch-specific // sidecar refs. NamespaceBranchSegment = "__branches__" // DefaultGuardrailMaxFiles is the default broad-plan file threshold. DefaultGuardrailMaxFiles = 100 // DefaultGuardrailMaxBytes is the default broad-plan byte threshold. DefaultGuardrailMaxBytes int64 = 10_485_760 // DefaultPrePushTimeout is the default timeout for the read-only pre-push gate. DefaultPrePushTimeout = 30 * time.Second // DefaultAllowSkipEnv is the audited strict pre-commit bypass variable. DefaultAllowSkipEnv = "SKEEPER_SKIP" )
Variables ¶
This section is empty.
Functions ¶
func CleanNamespace ¶ added in v0.1.1
CleanNamespace validates a sidecar namespace and returns its canonical slash-separated form.
func DefaultPatterns ¶
func DefaultPatterns() []string
DefaultPatterns returns the interactive init defaults.
func NormalizePatterns ¶ added in v0.1.1
NormalizePatterns validates and canonicalizes doublestar path globs while preserving their order.
Types ¶
type Config ¶
type Config struct {
Sidecar string `yaml:"sidecar"`
Bootstrap string `yaml:"bootstrap,omitempty"`
Settings Settings `yaml:"settings,omitempty"`
Namespaces []Namespace `yaml:"namespaces"`
}
Config describes how a project mirrors spec files into its sidecar repo.
type GuardrailSettings ¶ added in v0.2.0
type GuardrailSettings struct {
MaxFiles int `yaml:"max_files,omitempty"`
MaxBytes int64 `yaml:"max_bytes,omitempty"`
}
GuardrailSettings bounds broad mutating plans.
type HookSettings ¶ added in v0.2.0
type HookSettings struct {
PrePushTimeout string `yaml:"pre_push_timeout,omitempty"`
AllowSkipEnv string `yaml:"allow_skip_env,omitempty"`
}
HookSettings configures managed Git hooks.
type Namespace ¶ added in v0.1.1
type Namespace struct {
Name string `yaml:"name"`
Patterns []string `yaml:"patterns"`
Exclude []string `yaml:"exclude,omitempty"`
RespectGitignore *bool `yaml:"respect_gitignore,omitempty"`
}
Namespace routes a set of project files into one sidecar namespace.
func NormalizeNamespaces ¶ added in v0.1.1
NormalizeNamespaces validates and canonicalizes namespace routing rules.
func (Namespace) Includes ¶ added in v0.1.1
Includes reports whether path matches namespace's include patterns.
func (Namespace) Owns ¶ added in v0.1.1
Owns reports whether path belongs to namespace after applying excludes.
func (Namespace) RespectsGitignore ¶ added in v0.2.0
RespectsGitignore reports whether Git ignore sources should prune matches.
type Settings ¶ added in v0.2.0
type Settings struct {
Guardrails GuardrailSettings `yaml:"guardrails,omitempty"`
Hooks HookSettings `yaml:"hooks,omitempty"`
}
Settings describes operational defaults outside namespace ownership rules.
func NormalizeSettings ¶ added in v0.2.0
NormalizeSettings validates and fills operational defaults.