-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.mjs
More file actions
47 lines (47 loc) · 1.54 KB
/
Copy pathcommitlint.config.mjs
File metadata and controls
47 lines (47 loc) · 1.54 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
// Commitlint config (ESM .mjs so the commitlint-github-action accepts it and we
// can express a function-based `ignores`).
//
// Conventional Commits, enforced by the `commit-lint` CI job. The rules mirror
// the documented policy in CLAUDE.md: a fixed type list, a mandatory scope from
// the release-mapped set, and ≤180-char lines.
//
// `ignores` exempts integration *merge* commits whose subject uses a
// `merge(<scope>): …` prefix. Commitlint's built-in `defaultIgnores` only skips
// subjects starting with `Merge ` (capital, GitHub's default), so these custom
// merge subjects would otherwise be linted as real commits and rejected on
// their `merge` "type". Merge commits are conventionally exempt from the type
// rules, so we skip them explicitly while keeping `defaultIgnores` on.
export default {
extends: ["@commitlint/config-conventional"],
defaultIgnores: true,
ignores: [(message) => /^merge\(/i.test(message)],
rules: {
"body-max-line-length": [1, "always", 180],
"footer-max-line-length": [1, "always", 180],
"header-max-length": [1, "always", 180],
"subject-case": [2, "never", ["upper-case", "pascal-case"]],
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"perf",
"test",
"build",
"ci",
"chore",
"revert",
],
],
"scope-enum": [
2,
"always",
["cli", "daemon", "contract", "ci", "release", "repo", "deps"],
],
"scope-empty": [2, "never"],
},
};