Skip to content

Commit f0b83d8

Browse files
committed
feat: ignore fixup and squash commit (#17)
1 parent 318a67f commit f0b83d8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

source/library/is-ignored.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import semver from 'semver';
33
const WILDCARDS = [
44
c => c.match(/^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))$)/),
55
c => c.match(/^(R|r)evert (.*)/),
6+
c => c.match(/^(fixup|squash)!/),
67
c => semver.valid(c)
78
];
89

source/library/is-ignored.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ test('should return true for npm version commits', t => {
4040
t.true(isIgnored(`0.0.1-some-crazy-tag.999`));
4141
t.true(isIgnored(`0.0.1-1e69d54`));
4242
});
43+
44+
test('should return true fixup commits', t => {
45+
t.true(isIgnored('fixup! initial commit'));
46+
});
47+
48+
test('should return true squash commits', t => {
49+
t.true(isIgnored('squash! initial commit'));
50+
});

0 commit comments

Comments
 (0)