Skip to content

Commit

Permalink
fix: use grouped regex to ignore merge commits (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric authored and marionebl committed Sep 15, 2018
1 parent c0c6d5a commit 905e9d5
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/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import semver from 'semver';
const WILDCARDS = [
c =>
c.match(
/^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))(?:\r?\n)*$)/
/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/
),
c => c.match(/^(R|r)evert (.*)/),
c => c.match(/^(fixup|squash)!/),
Expand Down
4 changes: 4 additions & 0 deletions @commitlint/is-ignored/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@ test('should return true for bitbucket merge commits', t => {
test('should return true for automatic merge commits', t => {
t.true(isIgnored('Auto-merged develop into master'));
});

test('should return false for commits containing, but not starting, with merge branch', t => {
t.false(isIgnored('foo bar Merge branch xxx'));
});

0 comments on commit 905e9d5

Please sign in to comment.