config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles parsing and validation of .yeet.toml configuration files.

Index

Constants

View Source
const DefaultFile = ".yeet.toml"
View Source
const DefaultSchemaURL = "https://raw.githubusercontent.com/monkescience/yeet/main/yeet.schema.json"
View Source
const SchemaDirective = "#:schema " + DefaultSchemaURL

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config")

Functions

This section is empty.

Types

type AutoMergeMethod added in v0.1.2

type AutoMergeMethod = string
const (
	AutoMergeMethodAuto   AutoMergeMethod = "auto"
	AutoMergeMethodSquash AutoMergeMethod = "squash"
	AutoMergeMethodRebase AutoMergeMethod = "rebase"
	AutoMergeMethodMerge  AutoMergeMethod = "merge"
)

type CalVerConfig

type CalVerConfig struct {
	Format string `toml:"format"`
}

type ChangelogConfig

type ChangelogConfig struct {
	File     string            `toml:"file"`
	Include  []string          `toml:"include"`
	Sections map[string]string `toml:"sections"`
}

type Config

type Config struct {
	Versioning   VersioningStrategy `toml:"versioning"`
	Branch       string             `toml:"branch"`
	Provider     ProviderType       `toml:"provider"`
	TagPrefix    string             `toml:"tag_prefix"`
	Repository   RepositoryConfig   `toml:"repository"`
	VersionFiles []string           `toml:"version_files,omitempty"`
	Release      ReleaseConfig      `toml:"release"`
	Changelog    ChangelogConfig    `toml:"changelog"`
	CalVer       CalVerConfig       `toml:"calver"`
}

func Default

func Default() *Config

func Load

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

func Parse

func Parse(data []byte) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type ProviderType

type ProviderType = string
const (
	ProviderGitHub ProviderType = "github"
	ProviderGitLab ProviderType = "gitlab"
)

type ReleaseConfig

type ReleaseConfig struct {
	SubjectIncludeBranch bool            `toml:"subject_include_branch"`
	AutoMerge            bool            `toml:"auto_merge"`
	AutoMergeForce       bool            `toml:"auto_merge_force"`
	AutoMergeMethod      AutoMergeMethod `toml:"auto_merge_method"`
	PRBodyHeader         string          `toml:"pr_body_header"`
	PRBodyFooter         string          `toml:"pr_body_footer"`
}

type RepositoryConfig added in v0.1.3

type RepositoryConfig struct {
	Remote  string `toml:"remote"`
	Host    string `toml:"host"`
	Owner   string `toml:"owner"`
	Repo    string `toml:"repo"`
	Project string `toml:"project"`
}

type VersioningStrategy

type VersioningStrategy = string
const (
	// VersioningSemver uses semantic versioning (MAJOR.MINOR.PATCH).
	VersioningSemver VersioningStrategy = "semver"
	// VersioningCalVer uses calendar versioning (e.g., YYYY.0M.MICRO).
	VersioningCalVer VersioningStrategy = "calver"
)

Jump to

Keyboard shortcuts

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