diff --git a/@commitlint/is-ignored/src/index.js b/@commitlint/is-ignored/src/index.js index 1dda24cb4b..813cb8b34d 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 (.*?))(?:\r?\n)?$)/ + /^(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 f5646f11fe..8adb2260dd 100644 --- a/@commitlint/is-ignored/src/index.test.js +++ b/@commitlint/is-ignored/src/index.test.js @@ -52,6 +52,11 @@ test('should return true for branch merges with newline characters', t => { t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n")); }); +test('should return true for branch merges with multiple newline characters', t => { + t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\n\n\n")); + t.true(isIgnored("Merge branch 'ctrom-YarnBuild'\r\n\r\n\r\n")); +}); + test('should return true for merged PRs', t => { t.true(isIgnored('Merge pull request #369')); });