Skip to content

Commit

Permalink
feat: Limit scopes to the set of available types (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
yokuze committed Aug 21, 2019
1 parent 0e2938e commit c9b9b27
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions commitlint.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
'use strict';

var VALID_TYPES;

VALID_TYPES = [
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
];

module.exports = {
rules: {
'body-leading-blank': [ 2, 'always' ],
Expand All @@ -8,7 +24,7 @@ module.exports = {
'footer-max-line-length': [ 2, 'always', 90 ],
'header-max-length': [ 2, 'always', 72 ],
'scope-case': [ 2, 'always', [ 'lower-case', 'kebab-case' ] ],
'scope-empty': [ 2, 'always' ],
'scope-enum': [ 2, 'always', VALID_TYPES ],
'subject-case': [
2,
'never',
Expand All @@ -21,20 +37,9 @@ module.exports = {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
'sub',
],
// In addition to the standard types, allow "sub" for commits that support a
// larger feature, fix, etc.
VALID_TYPES.concat([ 'sub' ]),
],
},
};

0 comments on commit c9b9b27

Please sign in to comment.