Documentation
¶
Overview ¶
Package config handles parsing and validation of .yeet.yaml configuration files.
Index ¶
Constants ¶
View Source
const DefaultFile = ".yeet.yaml"
View Source
const DefaultSchemaURL = "https://raw.githubusercontent.com/monkescience/yeet/main/yeet.schema.json"
View Source
const SchemaDirective = "# yaml-language-server: $schema=" + DefaultSchemaURL
Variables ¶
View Source
var ErrEmptyRepoPath = errors.New("must not be empty")
View Source
var ErrInvalidConfig = errors.New("invalid config")
View Source
var ErrPathMustBeRepoRelative = errors.New("must be repo-relative")
Functions ¶
func RepoPathContains ¶ added in v0.4.0
RepoPathContains reports whether candidatePath is inside basePath using repo-relative forward-slash semantics. A basePath of "." contains everything.
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 `yaml:"format"`
}
type ChangelogConfig ¶
type Config ¶
type Config struct {
Versioning VersioningStrategy `yaml:"versioning"`
Branch string `yaml:"branch"`
Provider ProviderType `yaml:"provider"`
Repository RepositoryConfig `yaml:"repository"`
VersionFiles []string `yaml:"version_files,omitempty"`
Release ReleaseConfig `yaml:"release"`
Changelog ChangelogConfig `yaml:"changelog"`
CalVer CalVerConfig `yaml:"calver"`
Targets map[string]Target `yaml:"targets"`
}
func (*Config) ResolvedTargets ¶ added in v0.4.0
func (c *Config) ResolvedTargets() (map[string]ResolvedTarget, error)
type ProviderType ¶
type ProviderType = string
const ( ProviderAuto ProviderType = "auto" ProviderGitHub ProviderType = "github" ProviderGitLab ProviderType = "gitlab" )
type ReleaseConfig ¶
type ReleaseConfig struct {
SubjectIncludeBranch bool `yaml:"subject_include_branch"`
AutoMerge bool `yaml:"auto_merge"`
AutoMergeForce bool `yaml:"auto_merge_force"`
AutoMergeMethod AutoMergeMethod `yaml:"auto_merge_method"`
PRBodyHeader string `yaml:"pr_body_header"`
}
type RepositoryConfig ¶ added in v0.1.3
type ResolvedTarget ¶ added in v0.4.0
type ResolvedTarget struct {
ID string
Type TargetType
Path string
TagPrefix string
Versioning VersioningStrategy
VersionFiles []string
Changelog ChangelogConfig
CalVer CalVerConfig
ExcludePaths []string
Includes []string
}
type Target ¶ added in v0.4.0
type Target struct {
Type TargetType `yaml:"type"`
Path string `yaml:"path,omitempty"`
TagPrefix string `yaml:"tag_prefix,omitempty"`
Versioning VersioningStrategy `yaml:"versioning,omitempty"`
VersionFiles []string `yaml:"version_files,omitempty"`
Changelog ChangelogConfig `yaml:"changelog,omitempty"`
CalVer CalVerConfig `yaml:"calver,omitempty"`
ExcludePaths []string `yaml:"exclude_paths,omitempty"`
Includes []string `yaml:"includes,omitempty"`
}
type TargetType ¶ added in v0.4.0
type TargetType = string
const ( TargetTypePath TargetType = "path" TargetTypeDerived TargetType = "derived" )
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" )
Click to show internal directories.
Click to hide internal directories.