chore: move commit-lint to cli

This commit is contained in:
陈嘉涵
2019-08-22 14:01:53 +08:00
parent bcc6868c06
commit fc111cdfc7
6 changed files with 32 additions and 13 deletions

View File

@@ -1,34 +0,0 @@
const fs = require('fs');
const signale = require('signale');
const gitParams = process.env.HUSKY_GIT_PARAMS;
const commitMsg = fs.readFileSync(gitParams, 'utf-8').trim();
const commitRE = /^(revert: )?(fix|feat|docs|perf|test|types|build|chore|refactor|breaking change)(\(.+\))?: .{1,50}/;
if (!commitRE.test(commitMsg)) {
signale.error(`Error: invalid commit message format.
Proper commit message format is required for automated changelog generation.
Examples:
- fix(Button): incorrect style
- feat(Button): incorrect style
- docs(Button): fix typo
Allowed Types:
- fix
- feat
- docs
- perf
- test
- types
- build
- chore
- refactor
- breaking change
`);
process.exit(1);
}