Skip to content

Commit

Permalink
fix: ignore branch merges with newlines (#214)
Browse files Browse the repository at this point in the history
* fix: ignore branch merges with newlines

* fix: remove stray console.log
  • Loading branch information
marionebl committed Jan 9, 2018
1 parent 87eb33b commit c94c4dc
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 (.*?))$)/
/^(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 @@ -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'));
});
Expand Down

0 comments on commit c94c4dc

Please sign in to comment.