Skip to content

Commit

Permalink
fix: ignore branch merges with multiple newlines (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrom authored and marionebl committed Jan 12, 2018
1 parent 8ff5be2 commit 1f0c5ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion @commitlint/is-ignored/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)!/),
Expand Down
5 changes: 5 additions & 0 deletions @commitlint/is-ignored/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
Expand Down

0 comments on commit 1f0c5ca

Please sign in to comment.