-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcommitlint.config.mjs
More file actions
47 lines (44 loc) · 2.59 KB
/
Copy pathcommitlint.config.mjs
File metadata and controls
47 lines (44 loc) · 2.59 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
export default {
extends: ['@commitlint/config-conventional'],
rules: {
// Allow longer body lines (default is 100, increase to 200 for detailed technical explanations)
'body-max-line-length': [1, 'always', 200],
// Match the body limit for footers. The conventional-commits parser classifies any
// "word: value" line (e.g. a "L=2, per-epoch: ..." benchmark line, or a squashed PR's
// "* fix(x): ..." bullet) as a footer, so detailed messages tripped the default 100.
// Kept a warning at 200, consistent with body-max-line-length above.
'footer-max-line-length': [1, 'always', 200],
// Add 'deps' as valid type for dependabot commits
'type-enum': [2, 'always', [
'feat', 'fix', 'docs', 'refactor', 'perf', 'test', 'chore', 'ci', 'build', 'style', 'revert', 'merge',
'deps' // For dependency updates (dependabot)
]],
},
ignores: [
// ===== Merge Commits ONLY =====
// These are the ONLY legitimate ignores - merge commits cannot follow conventional format
// Ignore GitHub auto-generated merge commits (PR merges)
(message) => /^Merge pull request #\d+/.test(message),
// Ignore merge commits when merging branches
(message) => /^Merge branch '.+'/.test(message),
// Ignore merge commits from remote
(message) => /^Merge remote-tracking branch/.test(message),
// Ignore general merge commits containing "Merge" followed by common patterns
(message) => /^Merge (origin|upstream|master|main)/i.test(message),
// ===== GitHub Actions Bot Commits =====
// Ignore commits made by GitHub Actions (auto-fixes, dependabot, etc.)
(message) => /Co-Authored-By: github-actions\[bot\]/.test(message),
// Dependabot signs off rather than co-authoring, so the rule above never matched it and the
// ignore never covered the case its own comment names. Its subjects are "deps: Bump X from A to
// B" — 'deps' is already an accepted type above, but the capitalised "Bump" trips subject-case,
// and the wording is dependabot's to choose, not this repo's. Any PR whose range still contains
// a dependabot commit therefore failed the job outright.
(message) => /Signed-off-by: dependabot\[bot\]/.test(message),
// NOTE: All legacy ignores have been REMOVED as of 2025-12-14.
// The pr-title-lint.yml and commitlint-autofix.yml workflows now handle
// auto-fixing non-compliant PR titles and commit messages.
// All new commits MUST follow conventional commits format:
// type(scope)?: description
// Valid types: feat, fix, docs, refactor, perf, test, chore, ci, build, style, revert, merge, deps
]
};