Skip to content

Commit

Permalink
fix(is-ignored): ignore "amend!" commits (#4024)
Browse files Browse the repository at this point in the history
* fix(is-ignored): ignore "amend!" commits

* add test
  • Loading branch information
chalkygames123 committed Apr 14, 2024
1 parent 52d7edc commit 90078f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion @commitlint/is-ignored/src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const wildcards: Matcher[] = [
),
test(/^(Merge tag (.*?))(?:\r?\n)*$/m),
test(/^(R|r)evert (.*)/),
test(/^(fixup|squash)!/),
test(/^(amend|fixup|squash)!/),
isSemver,
test(/^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))/),
test(/^Merge remote-tracking branch(\s*)(.*)/),
Expand Down
4 changes: 4 additions & 0 deletions @commitlint/is-ignored/src/is-ignored.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ test('should ignore npm semver commits with footers', () => {
);
});

test('should return true amend commits', () => {
expect(isIgnored('amend! initial commit')).toBe(true);
});

test('should return true fixup commits', () => {
expect(isIgnored('fixup! initial commit')).toBe(true);
});
Expand Down

0 comments on commit 90078f6

Please sign in to comment.