Skip to content

Commit c94c4dc

Browse files
committed
fix: ignore branch merges with newlines (#214)
* fix: ignore branch merges with newlines * fix: remove stray console.log
1 parent 87eb33b commit c94c4dc

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 (.*?))$)/
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
@@ -47,6 +47,11 @@ test('should return true for branch merges', t => {
4747
t.true(isIgnored("Merge branch 'iss53'"));
4848
});
4949

50+
test('should return true for branch merges with newline characters', t => {
51+
t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\n"));
52+
t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n"));
53+
});
54+
5055
test('should return true for merged PRs', t => {
5156
t.true(isIgnored('Merge pull request #369'));
5257
});

0 commit comments

Comments
 (0)