Skip to content

Commit 905e9d5

Browse files
byCedricmarionebl
authored andcommitted
fix: use grouped regex to ignore merge commits (#439)
1 parent c0c6d5a commit 905e9d5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

@commitlint/is-ignored/src/index.js

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

@commitlint/is-ignored/src/index.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,7 @@ test('should return true for bitbucket merge commits', t => {
107107
test('should return true for automatic merge commits', t => {
108108
t.true(isIgnored('Auto-merged develop into master'));
109109
});
110+
111+
test('should return false for commits containing, but not starting, with merge branch', t => {
112+
t.false(isIgnored('foo bar Merge branch xxx'));
113+
});

0 commit comments

Comments
 (0)