2021-02-14 04:04:32 +00:00
|
|
|
package sv
|
|
|
|
|
|
|
|
// CommitMessageConfig config a commit message.
|
|
|
|
type CommitMessageConfig struct {
|
|
|
|
Types []string
|
|
|
|
Scope CommitMessageScopeConfig
|
|
|
|
Footer map[string]CommitMessageFooterConfig
|
2021-02-14 04:48:11 +00:00
|
|
|
Issue CommitMessageIssueConfig
|
2021-02-14 04:04:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// IssueConfig config for issue.
|
|
|
|
func (c CommitMessageConfig) IssueConfig() CommitMessageFooterConfig {
|
|
|
|
if v, exists := c.Footer[issueKey]; exists {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
return CommitMessageFooterConfig{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// BreakingChangeConfig config for breaking changes.
|
|
|
|
func (c CommitMessageConfig) BreakingChangeConfig() CommitMessageFooterConfig {
|
|
|
|
if v, exists := c.Footer[breakingKey]; exists {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
return CommitMessageFooterConfig{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommitMessageScopeConfig config scope preferences.
|
|
|
|
type CommitMessageScopeConfig struct {
|
|
|
|
Mandatory bool
|
|
|
|
Values []string
|
|
|
|
}
|
|
|
|
|
|
|
|
// CommitMessageFooterConfig config footer metadata.
|
|
|
|
type CommitMessageFooterConfig struct {
|
|
|
|
Key string
|
|
|
|
KeySynonyms []string
|
|
|
|
UseHash bool
|
|
|
|
}
|
2021-02-14 04:48:11 +00:00
|
|
|
|
|
|
|
// CommitMessageIssueConfig issue preferences.
|
|
|
|
type CommitMessageIssueConfig struct {
|
|
|
|
Regex string
|
|
|
|
}
|
|
|
|
|
|
|
|
// BranchesConfig branches preferences.
|
|
|
|
type BranchesConfig struct {
|
|
|
|
PrefixRegex string
|
|
|
|
SuffixRegex string
|
|
|
|
ExpectIssue bool
|
|
|
|
Skip []string
|
|
|
|
}
|