-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.commitlintrc.js
More file actions
executable file
·52 lines (52 loc) · 1.69 KB
/
.commitlintrc.js
File metadata and controls
executable file
·52 lines (52 loc) · 1.69 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
module.exports = {
extends: ["@commitlint/config-conventional"],
plugins: [
{
rules: {
// custom rule: enforce scope formats
// - for `retry`: require a result code scope: WA,TLE,OLE,MLE,RE,PE,CE,CREDIT (e.g. retry(WA))
// - for `solve` and `skip`: no special validation
"scope-format": (parsed) => {
const t = parsed.type;
const s = parsed.scope || "";
if (t === "retry") {
const ok = /^(WA|TLE|OLE|MLE|RE|PE|CE|CREDIT)$/.test(s);
return [
ok,
"For type 'retry' the scope must be one of WA,TLE,OLE,MLE,RE,PE,CE,CREDIT (e.g. retry(WA))",
];
}
return [true];
},
},
},
],
rules: {
"header-max-length": [1, "always", 50],
"body-max-line-length": [1, "always", 72],
// allowed commit types (prefixes)
"type-enum": [
2,
"always",
[
"refactor",
"docs",
"test",
"revert",
"perf",
"build",
"solve",
"chore",
"fix",
"ci",
"skip",
"retry",
"style",
],
],
// activate custom scope-format plugin rule
"scope-format": [2, "always"],
// disable subject-case enforcement so both "Do it" and "do it" are accepted
"subject-case": [0, "always"],
},
};