-
Notifications
You must be signed in to change notification settings - Fork 106
/
commitlint.config.js
26 lines (26 loc) · 1 KB
/
commitlint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'example']],
'code-review-rule': [0, 'always'],
},
defaultIgnores: false,
ignores: [
(message) => message.startsWith('chore(bors): merge pull request #'),
(message) => message.startsWith('Merge #')
],
plugins: [
{
rules: {
'code-review-rule': ({subject}) => {
const REVIEW_COMMENTS = `Please don't merge code-review commits, instead squash them in the parent commit`;
if (subject.includes('code-review')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('review comment')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('address comment')) return [ false, REVIEW_COMMENTS ];
if (subject.includes('addressed comment')) return [ false, REVIEW_COMMENTS ];
return [ true ];
},
},
},
],
}