Skip to content

Commit 1f0c5ca

Browse files
ctrommarionebl
authored andcommitted
fix: ignore branch merges with multiple newlines (#227)
1 parent 8ff5be2 commit 1f0c5ca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-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

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ test('should return true for branch merges with newline characters', t => {
5252
t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n"));
5353
});
5454

55+
test('should return true for branch merges with multiple newline characters', t => {
56+
t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\n\n\n"));
57+
t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n\r\n\r\n"));
58+
});
59+
5560
test('should return true for merged PRs', t => {
5661
t.true(isIgnored('Merge pull request #369'));
5762
});

0 commit comments

Comments
 (0)