-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
39 lines (38 loc) · 1.02 KB
/
Copy pathcommitlint.config.cjs
File metadata and controls
39 lines (38 loc) · 1.02 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
const allowedTypes = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"simplify",
"style",
"test",
];
module.exports = {
defaultIgnores: false,
ignores: [
(message) => /^Merge[ \t]/.test(message),
// Git-generated revert headers quote the reverted subject verbatim, so the
// header cannot satisfy the typed-header rules. Accept the canonical
// header whether the body is Git's autogenerated "This reverts commit"
// line or an author-written explanation of why the revert was needed.
(message) => /^Revert "[^\r\n]+"(?:\r?\n(?:\r?\n[\s\S]*)?)?$/.test(message),
],
parserPreset: {
name: "tracedecay",
parserOpts: {
headerCorrespondence: ["type", "scope", "breaking", "subject"],
headerPattern: /^(\w*)(?:\(([A-Za-z0-9._/-]+)\))?(!)?: ([^\s].*)$/,
},
},
rules: {
"header-max-length": [2, "always", 72],
"subject-empty": [2, "never"],
"type-empty": [2, "never"],
"type-enum": [2, "always", allowedTypes],
},
};