cleanup(repo): clean up scopes and commit types

This commit is contained in:
victor savkin 2019-12-04 09:44:34 -05:00 committed by Victor Savkin
parent dbd94926bf
commit 59543a3b70

View File

@ -6,7 +6,7 @@ const gitMessage = require('child_process')
.toString() .toString()
.trim(); .trim();
const matchCommit = /(chore|build|feat|fix|refactor|style|docs)\((backend|testing|web|react|angular|nx)\):\s(([a-z0-9:\-\s])+)/g.test( const matchCommit = /(chore|feat|fix|cleanup|docs)\((angular|bazel|core|docs|nextjs|node|react|storybook|testing|repo|misc)\):\s(([a-z0-9:\-\s])+)/g.test(
gitMessage gitMessage
); );
const matchRelease = /Release/gi.test(gitMessage); const matchRelease = /Release/gi.test(gitMessage);
@ -17,20 +17,20 @@ if (exitCode === 0) {
} else { } else {
console.log( console.log(
'[Error]: Ho no! 😦 Your commit message: \n' + '[Error]: Ho no! 😦 Your commit message: \n' +
'-------------------------------------------------------------------\n' + '-------------------------------------------------------------------\n' +
gitMessage + gitMessage +
'\n-------------------------------------------------------------------' + '\n-------------------------------------------------------------------' +
'\n\n 👉️ Does not follow the commit message convention specified in the CONTRIBUTING.MD file.' '\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('\ntype(scope): subject \n BLANK LINE \n body');
console.log('\n'); console.log('\n');
console.log('possible types: chore|build|feat|fix|refactor|style|docs'); console.log('possible types: chore|build|feat|fix|cleanup|docs');
console.log( console.log(
'possible scopes: backend|testing|web|react|angular|nx (if unsure use "nx")' 'possible scopes: angular|bazel|core|docs|nextjs|node|react|storybook|testing|repo|misc (if unsure use "core")'
); );
console.log( console.log(
'\nEXAMPLE: \n' + '\nEXAMPLE: \n' +
'feat(nx): add an option to generate lazy-loadable modules\n' 'feat(nx): add an option to generate lazy-loadable modules\n'
); );
} }
process.exit(exitCode); process.exit(exitCode);