-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
89 lines (77 loc) · 4.14 KB
/
Copy pathcommitlint.config.js
File metadata and controls
89 lines (77 loc) · 4.14 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
83
84
85
86
87
88
89
// commitlint.config.js
// Enforces Conventional Commits specification across the entire monorepo.
// Documentation: https://commitlint.js.org | https://www.conventionalcommits.org
/** @type {import('@commitlint/types').UserConfig} */
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
// ── Type ─────────────────────────────────────────────────────────────────
// Allowed commit types for the CivicLens monorepo
"type-enum": [
2, // severity: error
"always",
[
"feat", // A new feature
"fix", // A bug fix
"docs", // Documentation changes only
"style", // Formatting, whitespace — no logic change
"refactor", // Code change that neither fixes a bug nor adds a feature
"perf", // Performance improvement
"test", // Adding or correcting tests
"chore", // Maintenance tasks (deps, build, tooling)
"ci", // CI/CD configuration changes
"revert", // Reverts a previous commit
"build", // Changes affecting the build system
],
],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
// ── Scope ────────────────────────────────────────────────────────────────
// Scopes map to the major subsystems of the project
"scope-enum": [
1, // severity: warning (scopes are optional but must be valid if used)
"always",
[
// Monorepo-level
"repo", // Root-level changes (CI, tooling, deps)
"docker", // Docker / Compose changes
// Backend API (Go)
"api", // General API changes
"auth", // Authentication & authorisation
"db", // Database layer (migrations, sqlc)
"reports", // Issue reports feature
"categories", // Report categories feature
"institutions", // Institution management
"users", // User management
// Frontend (Next.js admin panels)
"frontend", // General frontend changes
"admin", // Admin portal
// Mobile app (React Native)
"mobile", // General mobile changes
// Agentic system (LangGraph)
"agent", // AI/LLM agent system
"classifier", // Report classification pipeline
],
],
"scope-case": [2, "always", "lower-case"],
// ── Subject ──────────────────────────────────────────────────────────────
"subject-case": [0], // Disabled: allow uppercase letters for proper nouns (e.g. pgAdmin)
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."], // No trailing period
"subject-max-length": [2, "always", 100],
"subject-min-length": [2, "always", 10],
// ── Body ─────────────────────────────────────────────────────────────────
"body-leading-blank": [2, "always"], // Blank line between subject and body
"body-max-line-length": [2, "always", 100],
// ── Footer ───────────────────────────────────────────────────────────────
"footer-leading-blank": [2, "always"],
"footer-max-line-length": [2, "always", 100],
// ── Header ───────────────────────────────────────────────────────────────
"header-max-length": [2, "always", 100],
},
// Ignore merge commits and automated release commits
ignores: [
(commit) => commit.startsWith("Merge"),
(commit) => commit.startsWith("Revert"),
],
};