Skip to content

Commit 83d545e

Browse files
committed
ci(*): update commitlint config
Migrate to config-conventional from config-angular Update rulesets to match the commit guidelines and rules ref: #MANAGER-15915 Signed-off-by: Anoop N <[email protected]>
1 parent 790d90d commit 83d545e

File tree

3 files changed

+247
-175
lines changed

3 files changed

+247
-175
lines changed

.commitlintrc.js

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
const typeEnum = require('@commitlint/config-angular-type-enum');
2-
const types = [...typeEnum.value(), 'sync', 'release'];
1+
const COMMIT_TYPES = ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'sync', 'release'];
2+
const SUBJECT_CASE_TYPES = ['lower-case', 'start-case', 'pascal-case', 'upper-case'];
33

44
module.exports = {
5-
extends: ['@commitlint/config-angular'],
5+
extends: ['@commitlint/config-conventional'],
66
rules: {
7-
'type-enum': [2, 'always', types],
8-
},
7+
// Enforce lowercase for header (type(scope): title)
8+
'subject-case': [2, 'always', SUBJECT_CASE_TYPES],
9+
'scope-case': [2, 'always', 'lower-case'],
10+
'scope-empty': [2, 'never'],
11+
// Enforce a blank line between header and body
12+
'body-leading-blank': [2, 'always'],
13+
14+
// Enforce 'ref: MANAGER-123' format in the footer
15+
'references-empty': [1, 'never'],
16+
// Enforce Signed-off-by footer format
17+
'signed-off-by': [2, 'always', 'Signed-off-by:'],
18+
// Enforce specific commit types (feat, fix, etc.)
19+
'type-enum': [2, 'always', COMMIT_TYPES],
20+
'header-max-length': [2, 'always', 100],
21+
'footer-leading-blank' : [2, 'always']
22+
}
923
};

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
},
7070
"devDependencies": {
7171
"@babel/helper-string-parser": "^7.18.10",
72-
"@commitlint/cli": "^v18.4.4",
73-
"@commitlint/config-angular": "^v18.4.4",
72+
"@commitlint/cli": "^19.7.1",
73+
"@commitlint/config-conventional": "^19.7.1",
7474
"@cucumber/cucumber": "^10.0.1",
7575
"@ovh-ux/codename-generator": "^1.0.0",
7676
"@playwright/test": "^1.49.1",
@@ -132,4 +132,4 @@
132132
"node": "^22",
133133
"yarn": ">=1.21.1"
134134
}
135-
}
135+
}

0 commit comments

Comments
 (0)