-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
56 lines (53 loc) · 1.39 KB
/
Copy pathcommitlint.config.cjs
File metadata and controls
56 lines (53 loc) · 1.39 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module.exports = {
extends: ['@commitlint/config-conventional'],
plugins: [
{
rules: {
'no-ai-generated': parsed => {
const message = parsed.raw;
const forbiddenStrings = [
'🤖 Generated with [Claude Code](https://claude.ai/code)',
'Co-Authored-By: Claude <noreply@anthropic.com>',
];
for (const forbiddenString of forbiddenStrings) {
if (message.includes(forbiddenString)) {
return [
false,
`Commit message contains forbidden AI-generated content: "${forbiddenString}"`,
];
}
}
return [true, ''];
},
},
},
],
rules: {
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'subject-max-length': [2, 'always', 72],
'body-max-line-length': [2, 'always', 100],
'footer-max-line-length': [2, 'always', 100],
'type-enum': [
2,
'always',
[
'feat',
'fix',
'docs',
'style',
'refactor',
'perf',
'test',
'build',
'ci',
'chore',
'revert',
],
],
'no-ai-generated': [2, 'always'],
},
helpUrl: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
};