0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-11-13 01:10:39 +00:00
git-sv/sv/config.go

52 lines
1.2 KiB
Go
Raw Normal View History

package sv
// CommitMessageConfig config a commit message.
type CommitMessageConfig struct {
Types []string
Scope CommitMessageScopeConfig
Footer map[string]CommitMessageFooterConfig
Issue CommitMessageIssueConfig
}
// 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
}
// CommitMessageIssueConfig issue preferences.
type CommitMessageIssueConfig struct {
Regex string
}
// BranchesConfig branches preferences.
type BranchesConfig struct {
PrefixRegex string
SuffixRegex string
ExpectIssue bool
Skip []string
}