2021-02-14 04:04:32 +00:00
|
|
|
package sv
|
|
|
|
|
2021-02-14 05:32:23 +00:00
|
|
|
// ==== Message ====
|
|
|
|
|
2021-02-14 04:04:32 +00:00
|
|
|
// CommitMessageConfig config a commit message.
|
|
|
|
type CommitMessageConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
Types []string `yaml:"types"`
|
|
|
|
Scope CommitMessageScopeConfig `yaml:"scope"`
|
|
|
|
Footer map[string]CommitMessageFooterConfig `yaml:"footer"`
|
|
|
|
Issue CommitMessageIssueConfig `yaml:"issue"`
|
2021-02-14 04:04:32 +00:00
|
|
|
}
|
|
|
|
|
2021-02-14 23:02:11 +00:00
|
|
|
// IssueFooterConfig config for issue.
|
|
|
|
func (c CommitMessageConfig) IssueFooterConfig() CommitMessageFooterConfig {
|
2021-02-14 04:04:32 +00:00
|
|
|
if v, exists := c.Footer[issueKey]; exists {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
return CommitMessageFooterConfig{}
|
|
|
|
}
|
|
|
|
|
2021-02-14 23:02:11 +00:00
|
|
|
// BreakingChangeFooterConfig config for breaking changes.
|
|
|
|
func (c CommitMessageConfig) BreakingChangeFooterConfig() CommitMessageFooterConfig {
|
2021-02-14 04:04:32 +00:00
|
|
|
if v, exists := c.Footer[breakingKey]; exists {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
return CommitMessageFooterConfig{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommitMessageScopeConfig config scope preferences.
|
|
|
|
type CommitMessageScopeConfig struct {
|
2021-02-14 23:18:29 +00:00
|
|
|
Values []string `yaml:"values"`
|
2021-02-14 04:04:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CommitMessageFooterConfig config footer metadata.
|
|
|
|
type CommitMessageFooterConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
Key string `yaml:"key"`
|
|
|
|
KeySynonyms []string `yaml:"key-synonyms"`
|
|
|
|
UseHash bool `yaml:"use-hash"`
|
2021-02-14 04:04:32 +00:00
|
|
|
}
|
2021-02-14 04:48:11 +00:00
|
|
|
|
|
|
|
// CommitMessageIssueConfig issue preferences.
|
|
|
|
type CommitMessageIssueConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
Regex string `yaml:"regex"`
|
2021-02-14 04:48:11 +00:00
|
|
|
}
|
|
|
|
|
2021-02-14 05:32:23 +00:00
|
|
|
// ==== Branches ====
|
|
|
|
|
2021-02-14 04:48:11 +00:00
|
|
|
// BranchesConfig branches preferences.
|
|
|
|
type BranchesConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
PrefixRegex string `yaml:"prefix"`
|
|
|
|
SuffixRegex string `yaml:"sufix"`
|
|
|
|
DisableIssue bool `yaml:"disable-issue"`
|
|
|
|
Skip []string `yaml:"skip"`
|
2021-02-14 04:48:11 +00:00
|
|
|
}
|
2021-02-14 05:32:23 +00:00
|
|
|
|
|
|
|
// ==== Versioning ====
|
|
|
|
|
|
|
|
// VersioningConfig versioning preferences.
|
|
|
|
type VersioningConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
UpdateMajor []string `yaml:"update-major"`
|
|
|
|
UpdateMinor []string `yaml:"update-minor"`
|
|
|
|
UpdatePatch []string `yaml:"update-patch"`
|
|
|
|
IgnoreUnknown bool `yaml:"ignore-unknown"`
|
2021-02-14 05:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ==== Tag ====
|
|
|
|
|
|
|
|
// TagConfig tag preferences.
|
|
|
|
type TagConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
Pattern string `yaml:"pattern"`
|
2021-02-14 05:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ==== Release Notes ====
|
|
|
|
|
|
|
|
// ReleaseNotesConfig release notes preferences.
|
|
|
|
type ReleaseNotesConfig struct {
|
2021-02-14 22:42:22 +00:00
|
|
|
Headers map[string]string `yaml:"headers"`
|
2021-02-14 05:32:23 +00:00
|
|
|
}
|