Skip to content

Commit 90078f6

Browse files
fix(is-ignored): ignore "amend!" commits (#4024)
* fix(is-ignored): ignore "amend!" commits * add test
1 parent 52d7edc commit 90078f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

@commitlint/is-ignored/src/defaults.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const wildcards: Matcher[] = [
2020
),
2121
test(/^(Merge tag (.*?))(?:\r?\n)*$/m),
2222
test(/^(R|r)evert (.*)/),
23-
test(/^(fixup|squash)!/),
23+
test(/^(amend|fixup|squash)!/),
2424
isSemver,
2525
test(/^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))/),
2626
test(/^Merge remote-tracking branch(\s*)(.*)/),

@commitlint/is-ignored/src/is-ignored.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ test('should ignore npm semver commits with footers', () => {
124124
);
125125
});
126126

127+
test('should return true amend commits', () => {
128+
expect(isIgnored('amend! initial commit')).toBe(true);
129+
});
130+
127131
test('should return true fixup commits', () => {
128132
expect(isIgnored('fixup! initial commit')).toBe(true);
129133
});

0 commit comments

Comments
 (0)