diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e69a401246697..a08f0574fec23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -116,7 +116,6 @@ The type must be one of the following: - refactor - style - docs -- test ##### Scope diff --git a/scripts/commit-lint.js b/scripts/commit-lint.js index 057c5fe57a718..93944d87e7b09 100755 --- a/scripts/commit-lint.js +++ b/scripts/commit-lint.js @@ -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); @@ -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);