Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore branch merges with multiple newlines #227

Merged
merged 1 commit into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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