File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ const (
2424 hotfixDesc string = "HOTFIX (Bug fix urgently)"
2525)
2626
27- const commitMessagePattern = `^(feat|fix|docs|style|refactor|test|chore|perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.*`
27+ const commitMessageCheckPattern = `^(feat|fix|docs|style|refactor|test|chore|perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.*`
2828
29- const commitMessageCheckFailedTpl = `
30- ######################################################
31- ## ##
32- ## 💔 The commit message is not standardized. ##
33- ## 💔 It must match the regular expression: ##
34- ## ##
35- ## ^(feat|fix|docs|style|refactor|test|chore| ##
36- ## perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.* ##
37- ## ##
38- ###################################################### `
29+ const commitMessageCheckFailedMsg = `
30+ ╭──────────────────────────────────────────────────╮
31+ │ │
32+ │ ✗ The commit message is not standardized. │
33+ │ ✗ It must match the regular expression: │
34+ │ │
35+ │ ^(feat|fix|docs|style|refactor|test|chore| │
36+ │ perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.* │
37+ │ │
38+ ╰──────────────────────────────────────────────────╯ `
Original file line number Diff line number Diff line change @@ -62,15 +62,15 @@ func push() error {
6262}
6363
6464func commitMessageCheck (f string ) error {
65- reg := regexp .MustCompile (commitMessagePattern )
65+ reg := regexp .MustCompile (commitMessageCheckPattern )
6666 bs , err := ioutil .ReadFile (f )
6767 if err != nil {
6868 return err
6969 }
7070
7171 msgs := reg .FindStringSubmatch (string (bs ))
7272 if len (msgs ) != 4 {
73- return fmt .Errorf (commitMessageCheckFailedTpl )
73+ return fmt .Errorf (commitMessageCheckFailedMsg )
7474 }
7575
7676 return nil
You can’t perform that action at this time.
0 commit comments