Skip to content

Commit

Permalink
feat(git-hooks): remove types mondatory issues
Browse files Browse the repository at this point in the history
Closes #7531
  • Loading branch information
Aleksandyr committed Jun 17, 2020
1 parent b487a82 commit 15586de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .hooks/scripts/templates/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -20,4 +20,4 @@ var defaults = {
oldMessagePath: path.join('.git', 'COMMIT_EDITMSG_OLD')
}

module.exports = defaults;
module.exports = defaults;
8 changes: 4 additions & 4 deletions .hooks/scripts/utils/issue-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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"));
}
}
}

0 comments on commit 15586de

Please sign in to comment.