Skip to content

Commit fe29ce7

Browse files
authored
fix(is-ignored): ignore azure devops messages (#2230)
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")
1 parent aa10417 commit fe29ce7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

@commitlint/is-ignored/src/defaults.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const wildcards: Matcher[] = [
2121
test(/^(R|r)evert (.*)/),
2222
test(/^(fixup|squash)!/),
2323
isSemver,
24-
test(/^Merged (.*?)(in|into) (.*)/),
25-
test(/^Merge remote-tracking branch (.*)/),
24+
test(/^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))/),
25+
test(/^Merge remote-tracking branch(\s*)(.*)/),
2626
test(/^Automatic merge(.*)/),
2727
test(/^Auto-merged (.*?) into (.*)/),
2828
];

@commitlint/is-ignored/src/is-ignored.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ test('should return true for bitbucket merge commits', () => {
122122

123123
test('should return true for automatic merge commits', () => {
124124
expect(isIgnored('Auto-merged develop into master')).toBe(true);
125+
expect(isIgnored('Merge remote-tracking branch')).toBe(true);
126+
});
127+
128+
test('should return true for azure devops merge commits', () => {
129+
expect(isIgnored('Merged PR 123: Description here')).toBe(true);
125130
});
126131

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

0 commit comments

Comments
 (0)