0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-06-03 03:49:39 +02:00

refactor: fix lint gosimple S1007

This commit is contained in:
Beatriz Vieira 2021-07-31 17:52:25 -03:00
parent 6fd31b9aa0
commit 178239a666

View File

@ -82,7 +82,7 @@ func (p MessageProcessorImpl) Validate(message string) error {
subject, body := splitCommitMessageContent(message)
msg := p.Parse(subject, body)
if !regexp.MustCompile("^[a-z+]+(\\(.+\\))?!?: .+$").MatchString(subject) {
if !regexp.MustCompile(`^[a-z+]+(\(.+\))?!?: .+$`).MatchString(subject) {
return fmt.Errorf("subject [%s] should be valid according with conventional commits", subject)
}
@ -229,7 +229,7 @@ func (p MessageProcessorImpl) Parse(subject, body string) CommitMessage {
}
func parseSubjectMessage(message string) (string, string, string, bool) {
regex := regexp.MustCompile("([a-z]+)(\\((.*)\\))?(!)?: (.*)")
regex := regexp.MustCompile(`([a-z]+)(\((.*)\))?(!)?: (.*)`)
result := regex.FindStringSubmatch(message)
if len(result) != 6 {
return "", "", message, false