Skip to content

Commit 1019114

Browse files
committed
chore: add .commit-check.yml config file
1 parent 65214c1 commit 1019114

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.commit-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
checks:
2+
3+
- check: commit_message
4+
regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
5+
error: "The commit message should be structured as follows:\n\n
6+
<type>[optional scope]: <description>\n
7+
[optional body]\n
8+
[optional footer(s)]\n\n
9+
More details please refer to https://www.conventionalcommits.org"
10+
suggest: 'git commit --amend'
11+
12+
- check: branch_name
13+
regex: '^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)'
14+
error: 'Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/'
15+
suggest: 'git checkout -b type/branch_name'
16+
17+
- check: author_name
18+
regex: r'^([a-zA-Z]{2,}\s[a-zA-Z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)'
19+
error: 'The user name seems invalid'
20+
suggest: 'git config user.name "Peter Shen"'
21+
22+
- check: author_email
23+
regex: '^\S+@\S+\.\S+$'
24+
error: 'The email address seems invalid'
25+
suggest: 'git config user.email xianpeng.shen@gmail.com'

0 commit comments

Comments
 (0)