config

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 9 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncrementSprint added in v0.4.0

func IncrementSprint(path string) (int, error)

IncrementSprint reads the config file at path, increments versioning.sprint by one, writes the file back preserving all other content, and returns the new value. If sprint is absent from the file (default 0), it is inserted and set to 1.

func InitDest

func InitDest() string

InitDest returns the path heraut init should write to: .config/heraut.yml if .config/ exists, else .heraut.yml.

func ResolvePath

func ResolvePath(explicit string) string

ResolvePath returns the config file to use:

  1. explicit if non-empty
  2. .config/heraut.yml if it exists
  3. .heraut.yml (default fallback)

Types

type Config

type Config struct {
	Version      string                 `yaml:"version"`
	Versioning   Versioning             `yaml:"versioning"`
	Changelog    *ContentDriver         `yaml:"changelog,omitempty"`
	Release      *Release               `yaml:"release,omitempty"`
	Environments map[string]Environment `yaml:"environments,omitempty"`
}

Config is the parsed .heraut.yml.

func Load

func Load(path string) (*Config, error)

Load reads and strictly parses the config file at path. Unknown YAML fields are rejected.

func LoadFromReader

func LoadFromReader(r io.Reader) (*Config, error)

LoadFromReader strictly parses config from r. Unknown YAML fields are rejected.

type ContentDriver

type ContentDriver struct {
	Generator  string `yaml:"generator"`
	Config     string `yaml:"config,omitempty"`
	Output     string `yaml:"output,omitempty"`
	TagPattern string `yaml:"tag_pattern,omitempty"`
	Template   string `yaml:"template,omitempty"`
}

ContentDriver configures a content generator (git-cliff, communique, cocogitto).

type EnvRelease added in v0.10.0

type EnvRelease struct {
	Notes     *ContentDriver `yaml:"notes,omitempty"`
	Platforms []Platform     `yaml:"platforms,omitempty"`
}

EnvRelease holds per-environment release overrides. Nil fields mean "inherit from root release", which differs from root Release where nil means "disabled".

type Environment added in v0.10.0

type Environment struct {
	// Versioning fields
	Bump      string `yaml:"bump"`
	TagFormat string `yaml:"tag_format,omitempty"`
	Branch    string `yaml:"branch,omitempty"`
	Source    string `yaml:"source,omitempty"`

	// Content fields
	DisableChangelog bool           `yaml:"disable_changelog,omitempty"`
	DisableNotes     bool           `yaml:"disable_notes,omitempty"`
	Changelog        *ContentDriver `yaml:"changelog,omitempty"`
	Release          *EnvRelease    `yaml:"release,omitempty"`
}

Environment holds all per-environment configuration under the root environments map. Versioning fields drive version resolution; content fields override changelog/release.

type Platform

type Platform struct {
	Type string `yaml:"platform"`
	// GitHub-specific
	Repository string `yaml:"repository,omitempty"`
	Draft      bool   `yaml:"draft,omitempty"`
	Prerelease bool   `yaml:"prerelease,omitempty"`
	// GitLab-specific
	Project string `yaml:"project,omitempty"`
	// Shared
	TokenEnv string   `yaml:"token_env,omitempty"`
	Assets   []string `yaml:"assets,omitempty"`
}

Platform holds settings for one release platform (github or gitlab). Type is the platform discriminator ("github" or "gitlab") mapping to yaml:"platform"; using Type avoids the Platform.Platform self-reference (ADR-0006).

type Release

type Release struct {
	Notes     *ContentDriver `yaml:"notes,omitempty"`
	Platforms []Platform     `yaml:"platforms,omitempty"`
}

Release holds release notes and platform settings.

type ValidationError

type ValidationError struct {
	Path    string
	Message string
	Hint    string
}

ValidationError describes a single semantic validation failure.

func (ValidationError) Error

func (e ValidationError) Error() string

type ValidationErrors

type ValidationErrors []ValidationError

ValidationErrors is a list of ValidationError that implements error.

func Validate

func Validate(cfg *Config) ValidationErrors

Validate runs all semantic validation layers against cfg. All errors are collected and returned; validation does not stop on the first error.

func (ValidationErrors) Error

func (ve ValidationErrors) Error() string

type Versioning

type Versioning struct {
	Strategy       string  `yaml:"strategy"`
	TagPrefix      *string `yaml:"tag_prefix,omitempty"`
	InitialVersion string  `yaml:"initial_version,omitempty"`
	Bump           string  `yaml:"bump,omitempty"`
	Format         string  `yaml:"format,omitempty"`
	Sprint         int     `yaml:"sprint,omitempty"`
	TagFormat      string  `yaml:"tag_format,omitempty"`
	TagType        string  `yaml:"tag_type,omitempty"`
}

Versioning holds version resolution settings.

Jump to

Keyboard shortcuts

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