Skip to content

Commit

Permalink
Merge pull request #70 from pbredenberg/pb/fix-disallow-fixup-commits
Browse files Browse the repository at this point in the history
fix: disallow fixup commits
  • Loading branch information
onebytegone authored Sep 6, 2023
2 parents 6d96faa + 80a32d1 commit 0a23d64
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 0a23d64

Please sign in to comment.