Documentation
¶
Overview ¶
Package config loads and writes the committed skeeper project config.
Index ¶
- Constants
- func CleanNamespace(namespace string) (string, error)
- func DefaultPatterns() []string
- func NormalizePatterns(patterns []string) ([]string, error)
- func Save(root string, cfg Config) error
- type Config
- type GuardrailSettings
- type HookSettings
- type HydratePolicy
- type HydrateRule
- type Namespace
- type Settings
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 HydratePolicy ¶ added in v0.2.1
type HydratePolicy struct {
OnLocalOnly string `yaml:"on_local_only,omitempty"`
OnModified string `yaml:"on_modified,omitempty"`
Rules []HydrateRule `yaml:"rules,omitempty"`
}
HydratePolicy configures namespace defaults for safe materialization.
func NormalizeHydratePolicy ¶ added in v0.2.1
func NormalizeHydratePolicy(policy HydratePolicy) (HydratePolicy, error)
NormalizeHydratePolicy validates and canonicalizes hydrate defaults.
type HydrateRule ¶ added in v0.2.1
type HydrateRule struct {
Pattern string `yaml:"pattern"`
OnLocalOnly string `yaml:"on_local_only,omitempty"`
OnModified string `yaml:"on_modified,omitempty"`
}
HydrateRule configures hydrate defaults for a subset of paths.
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"`
Hydrate HydratePolicy `yaml:"hydrate,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.