Skip to content

Commit

Permalink
feat: ignore fixup and squash commit (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Jul 7, 2017
1 parent 318a67f commit f0b83d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/library/is-ignored.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import semver from 'semver';
const WILDCARDS = [
c => c.match(/^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))$)/),
c => c.match(/^(R|r)evert (.*)/),
c => c.match(/^(fixup|squash)!/),
c => semver.valid(c)
];

Expand Down
8 changes: 8 additions & 0 deletions source/library/is-ignored.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ test('should return true for npm version commits', t => {
t.true(isIgnored(`0.0.1-some-crazy-tag.999`));
t.true(isIgnored(`0.0.1-1e69d54`));
});

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

test('should return true squash commits', t => {
t.true(isIgnored('squash! initial commit'));
});

0 comments on commit f0b83d8

Please sign in to comment.