diff --git a/@commitlint/is-ignored/src/index.js b/@commitlint/is-ignored/src/index.js index 9ef99f7220..1dda24cb4b 100644 --- a/@commitlint/is-ignored/src/index.js +++ b/@commitlint/is-ignored/src/index.js @@ -3,7 +3,7 @@ import semver from 'semver'; const WILDCARDS = [ c => c.match( - /^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))$)/ + /^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))(?:\r?\n)?$)/ ), c => c.match(/^(R|r)evert (.*)/), c => c.match(/^(fixup|squash)!/), diff --git a/@commitlint/is-ignored/src/index.test.js b/@commitlint/is-ignored/src/index.test.js index 5ee03b355f..f5646f11fe 100644 --- a/@commitlint/is-ignored/src/index.test.js +++ b/@commitlint/is-ignored/src/index.test.js @@ -47,6 +47,11 @@ test('should return true for branch merges', t => { t.true(isIgnored("Merge branch 'iss53'")); }); +test('should return true for branch merges with newline characters', t => { + t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\n")); + t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n")); +}); + test('should return true for merged PRs', t => { t.true(isIgnored('Merge pull request #369')); });