Repository navigation
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
47 lines (45 loc) · 1.55 KB
/
Copy pathcommitlint.config.js
File metadata and controls
47 lines (45 loc) · 1.55 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
// Conventional Commits policy for AgenticPay.
//
// Enforced in two places:
// - locally by the `.husky/commit-msg` hook (installed by `npm install`)
// - in CI by `.github/workflows/commitlint.yml`, which lints the PR title —
// PRs are squash-merged, so the title becomes the commit on `main` that
// semantic-release reads to pick the next version and write CHANGELOG.md.
//
// Behaviour is pinned by scripts/commitlint.test.mjs.
/** Types that appear in the changelog / drive a version bump, plus housekeeping. */
const TYPES = [
'feat',
'fix',
'perf',
'revert',
'docs',
'style',
'refactor',
'test',
'build',
'ci',
'chore',
];
/** @type {import('@commitlint/types').UserConfig} */
module.exports = {
extends: ['@commitlint/config-conventional'],
helpUrl:
'https://github.com/Smartdevs17/agenticpay/blob/main/CONTRIBUTING.md#commit-message-format',
rules: {
'type-enum': [2, 'always', TYPES],
'subject-case': [2, 'never', ['upper-case']],
'subject-empty': [2, 'never'],
'header-max-length': [2, 'always', 100],
'subject-max-length': [2, 'always', 100],
// Bodies regularly carry stack traces, URLs and generated release notes.
'body-max-line-length': [2, 'always', 200],
},
ignores: [
// Commits authored by semantic-release itself; their bodies are the
// generated release notes and are not subject to the human policy.
(message) => /^chore\(release\): \d+\.\d+\.\d+/.test(message),
],
// Keep commitlint's built-in ignores (merge, revert, fixup!, squash!, ...).
defaultIgnores: true,
};