Skip to content

Commit

Permalink
build(nx): more strickly enforce commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Aug 29, 2019
1 parent 929aeb7 commit 644047b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ The type must be one of the following:
- refactor
- style
- docs
- test

##### Scope

Expand Down
12 changes: 8 additions & 4 deletions scripts/commit-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const gitMessage = require('child_process')
.execSync('git log -1 --no-merges')
.toString()
.trim();
const matchCommit = /([a-z]){0,8}\([a-z.0-9\-]+\):\s(([a-z0-9:\-\s])+)/g.test(
const matchCommit = /(build|feat|fix|refactor|style|docs)\((backend|testing|web|react|angular|nx)\):\s(([a-z0-9:\-\s])+)/g.test(
gitMessage
);
const matchRelease = /release/gi.test(gitMessage);
Expand All @@ -22,10 +22,14 @@ if (exitCode === 0) {
'\n\n 👉️ Does not follow the commit message convention specified in the CONTRIBUTING.MD file.'
);
console.log('\ntype(scope): subject \n BLANK LINE \n body');
console.log('\n');
console.log('possible types: build|feat|fix|refactor|style|docs');
console.log(
'\nEXAMPLE: \n ' +
'feat(schematics): add an option to generate lazy-loadable modules\n' +
'\n`ng generate lib mylib --lazy` provisions the mylib project in tslint.json'
'possible scopes: backend|testing|web|react|angular|nx (if unsure use "nx")'
);
console.log(
'\nEXAMPLE: \n' +
'feat(nx): add an option to generate lazy-loadable modules\n'
);
}
process.exit(exitCode);

0 comments on commit 644047b

Please sign in to comment.