-
Notifications
You must be signed in to change notification settings - Fork 18
/
consts.go
44 lines (38 loc) · 1.73 KB
/
consts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
const (
feat string = "feat"
fix string = "fix"
docs string = "docs"
style string = "style"
refactor string = "refactor"
test string = "test"
chore string = "chore"
perf string = "perf"
hotfix string = "hotfix"
)
const (
featDesc string = "FEAT (Introducing new features)"
fixDesc string = "FIX (Bug fix)"
docsDesc string = "DOCS (Writing docs)"
styleDesc string = "STYLE (Improving structure/format of the code)"
refactorDesc string = "REFACTOR (Refactoring code)"
testDesc string = "TEST (When adding missing tests)"
choreDesc string = "CHORE (Changing CI/CD)"
perfDesc string = "PERF (Improving performance)"
hotfixDesc string = "HOTFIX (Bug fix urgently)"
)
const commitMessageCheckPattern = `^(feat|fix|docs|style|refactor|test|chore|perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.*`
const commitMessageCheckFailedMsg = `
╭──────────────────────────────────────────────────╮
│ │
│ ✗ The commit message is not standardized. │
│ ✗ It must match the regular expression: │
│ │
│ ^(feat|fix|docs|style|refactor|test|chore| │
│ perf|hotfix)\((\S.*)\):\s(\S.*)|^Merge.* │
│ │
╰──────────────────────────────────────────────────╯`
const editorKey = "//edit"
const newLineKey = `\\n `
const luckyCommitEnv = "MMH_LUCKY_COMMIT"
const strictHostKey = "MMH_STRICT_HOST_KEY"