diff --git a/.hooks/scripts/templates/default.js b/.hooks/scripts/templates/default.js index acfa9c8d397..29a6935030c 100644 --- a/.hooks/scripts/templates/default.js +++ b/.hooks/scripts/templates/default.js @@ -11,7 +11,7 @@ var defaults = { otherLine: 80, }, issuePattern: '(#)[0-9]+', - typesWithMandatoryIssue: [ 'feat', 'fix', 'test' ], + typesWithMandatoryIssue: [], guidelinesUrl: 'https://bit.ly/angular-guidelines', types: [ 'feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'build', 'ci', 'revert' @@ -20,4 +20,4 @@ var defaults = { oldMessagePath: path.join('.git', 'COMMIT_EDITMSG_OLD') } -module.exports = defaults; \ No newline at end of file +module.exports = defaults; diff --git a/.hooks/scripts/utils/issue-validator.js b/.hooks/scripts/utils/issue-validator.js index 73cf7db5596..28dc45c5908 100644 --- a/.hooks/scripts/utils/issue-validator.js +++ b/.hooks/scripts/utils/issue-validator.js @@ -6,9 +6,9 @@ var matchType = require('../common').matchType, module.exports = (lines, options, errors) => { var ticket = new RegExp(options.issuePattern); var whetherIssueIsMandatory = false, - wheterMatchAnyIssueRef = false; + wheterMatchAnyIssueRef = false; + - if (matchType(options.typesWithMandatoryIssue, lines[0])) { whetherIssueIsMandatory = true; } @@ -27,7 +27,7 @@ module.exports = (lines, options, errors) => { if (whetherIssueIsMandatory && !wheterMatchAnyIssueRef) { errors.push(errorFactory( - `The issue reference for (${options.typesWithMandatoryIssue.join(', ')}) types is mandatory!\n`, + `The issue reference for (${options.typesWithMandatoryIssue.join(', ')}) types is mandatory!\n`, "Please add at least one related issue. E.g: Closes #31, Closes #45")); } -} \ No newline at end of file +}