Skip to content

Commit

Permalink
fix(is-ignored): ignore azure devops messages (#2230)
Browse files Browse the repository at this point in the history
The following Azure DevOps auto-generated merge commit message formats are being considered erros:
- "Merge remote-tracking branch" (fails because is has no whitespace at the end)
- "Merged PR 123: Description here" (fails because it does not contain "in" or "into")
  • Loading branch information
toureholder committed Nov 3, 2020
1 parent aa10417 commit fe29ce7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions @commitlint/is-ignored/src/defaults.ts
Expand Up @@ -21,8 +21,8 @@ export const wildcards: Matcher[] = [
test(/^(R|r)evert (.*)/),
test(/^(fixup|squash)!/),
isSemver,
test(/^Merged (.*?)(in|into) (.*)/),
test(/^Merge remote-tracking branch (.*)/),
test(/^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))/),
test(/^Merge remote-tracking branch(\s*)(.*)/),
test(/^Automatic merge(.*)/),
test(/^Auto-merged (.*?) into (.*)/),
];
5 changes: 5 additions & 0 deletions @commitlint/is-ignored/src/is-ignored.test.ts
Expand Up @@ -122,6 +122,11 @@ test('should return true for bitbucket merge commits', () => {

test('should return true for automatic merge commits', () => {
expect(isIgnored('Auto-merged develop into master')).toBe(true);
expect(isIgnored('Merge remote-tracking branch')).toBe(true);
});

test('should return true for azure devops merge commits', () => {
expect(isIgnored('Merged PR 123: Description here')).toBe(true);
});

test('should return false for commits containing, but not starting, with merge branch', () => {
Expand Down

0 comments on commit fe29ce7

Please sign in to comment.