Skip to content

Commit

Permalink
fix: disallow fixup! commit messages in our commitlint config
Browse files Browse the repository at this point in the history
  • Loading branch information
pbredenberg committed Sep 1, 2023
1 parent 6d96faa commit 80a32d1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion commitlint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var VALID_TYPES;
var VALID_TYPES,
VALID_PREFIXES;

VALID_TYPES = [
'build',
Expand All @@ -17,6 +18,11 @@ VALID_TYPES = [
'test',
];

VALID_PREFIXES = [
'Merge',
'Revert',
];

module.exports = {
rules: {
'body-leading-blank': [ 2, 'always' ],
Expand All @@ -43,4 +49,15 @@ module.exports = {
VALID_TYPES.concat([ 'sub' ]),
],
},
// The default ignores of commitlint allow prefixes like fixup! and squash!,
// which we don't allow. Therefore, we're turning off defaultIgnores and
// explicitly ignoring only auto-generated merge commit and revert messages
defaultIgnores: false,
ignores: [
(commit) => {
return VALID_PREFIXES.some((prefix) => {
return commit.startsWith(prefix);
});
},
],
};

0 comments on commit 80a32d1

Please sign in to comment.