From 6184ac3ad44d575fc417dc05436cfd090f616003 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sat, 31 Jul 2021 16:39:38 -0300 Subject: [PATCH] refactor: fix tagliatelle yaml lint --- cmd/git-sv/config.go | 4 ++-- sv/config.go | 4 ++-- sv/message.go | 2 +- sv/message_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/git-sv/config.go b/cmd/git-sv/config.go index 9e34d6b..b9d9b26 100644 --- a/cmd/git-sv/config.go +++ b/cmd/git-sv/config.go @@ -76,8 +76,8 @@ func defaultConfig() Config { Tag: sv.TagConfig{Pattern: "%d.%d.%d"}, ReleaseNotes: sv.ReleaseNotesConfig{Headers: map[string]string{"fix": "Bug Fixes", "feat": "Features", "breaking-change": "Breaking Changes"}}, Branches: sv.BranchesConfig{ - PrefixRegex: "([a-z]+\\/)?", - SuffixRegex: "(-.*)?", + Prefix: "([a-z]+\\/)?", + Suffix: "(-.*)?", DisableIssue: false, Skip: []string{"master", "main", "developer"}, SkipDetached: &skipDetached, diff --git a/sv/config.go b/sv/config.go index 7342436..eb894e1 100644 --- a/sv/config.go +++ b/sv/config.go @@ -40,8 +40,8 @@ type CommitMessageIssueConfig struct { // BranchesConfig branches preferences. type BranchesConfig struct { - PrefixRegex string `yaml:"prefix"` - SuffixRegex string `yaml:"suffix"` + Prefix string `yaml:"prefix"` + Suffix string `yaml:"suffix"` DisableIssue bool `yaml:"disable-issue"` Skip []string `yaml:"skip,flow"` SkipDetached *bool `yaml:"skip-detached"` diff --git a/sv/message.go b/sv/message.go index fd08ef1..050ecf9 100644 --- a/sv/message.go +++ b/sv/message.go @@ -160,7 +160,7 @@ func (p MessageProcessorImpl) IssueID(branch string) (string, error) { return "", nil } - rstr := fmt.Sprintf("^%s(%s)%s$", p.branchesCfg.PrefixRegex, p.messageCfg.Issue.Regex, p.branchesCfg.SuffixRegex) + rstr := fmt.Sprintf("^%s(%s)%s$", p.branchesCfg.Prefix, p.messageCfg.Issue.Regex, p.branchesCfg.Suffix) r, err := regexp.Compile(rstr) if err != nil { return "", fmt.Errorf("could not compile issue regex: %s, error: %v", rstr, err.Error()) diff --git a/sv/message_test.go b/sv/message_test.go index 84068d5..e1f95d9 100644 --- a/sv/message_test.go +++ b/sv/message_test.go @@ -55,8 +55,8 @@ var ccfgWithScope = CommitMessageConfig{ func newBranchCfg(skipDetached bool) BranchesConfig { return BranchesConfig{ - PrefixRegex: "([a-z]+\\/)?", - SuffixRegex: "(-.*)?", + Prefix: "([a-z]+\\/)?", + Suffix: "(-.*)?", Skip: []string{"develop", "master"}, SkipDetached: &skipDetached, }