-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.commitlintrc.js
More file actions
82 lines (71 loc) · 2.06 KB
/
.commitlintrc.js
File metadata and controls
82 lines (71 loc) · 2.06 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Commitlint config — enforces Conventional Commits 1.0.0 + the project scope allowlist.
// Reference: https://commitlint.js.org/
// Used by .github/workflows/commitlint.yml to validate PR titles + commits.
// Scope list synced with docs/scopes.md (human-readable version).
//
// This is JS (not YAML) because `ignores` requires a predicate function: merge
// commits are not Conventional Commits, and the 4-tier branch flow
// (feature -> release -> dev -> main) produces merge commits at release -> dev
// and dev -> main. commitlint's built-in defaultIgnores only skips standard
// "Merge branch X into Y" / "Merge pull request" messages; an explicit ignore
// for any "Merge "-prefixed (and "Revert ") subject keeps the lint green for
// every merge commit regardless of how the message is phrased.
module.exports = {
extends: ["@commitlint/config-conventional"],
// Skip non-Conventional, git-generated commits. Belt-and-suspenders over
// commitlint's defaultIgnores (which stays enabled).
ignores: [
(message) =>
message.startsWith("Merge ") || message.startsWith("Revert "),
],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"perf",
"docs",
"style",
"refactor",
"test",
"build",
"ci",
"chore",
"revert",
],
],
"scope-enum": [
2,
"always",
[
"core",
"domain",
"infra",
"dreaming",
"search",
"embedding",
"mindql",
"storage",
"extensions",
"cli",
"config",
"docs",
"bench",
"deps",
"release",
"ci",
"build",
],
],
// warning only — some commits (e.g. pure `chore:`) may omit scope
"scope-empty": [1, "never"],
"header-max-length": [2, "always", 100],
"subject-full-stop": [2, "never", "."],
"body-leading-blank": [2, "always"],
"footer-leading-blank": [2, "always"],
"type-empty": [2, "never"],
"subject-empty": [2, "never"],
},
};