Skip to content

Commit 7413d0b

Browse files
committed
feat: add commitlint configuration for conventional commits
- Add commitlint.config.js with conventional commit rules - Update .pre-commit-config.yaml to include commit-msg hook type - Configure type validation and subject formatting rules - Enable automatic commit message validation on commits
1 parent b76236b commit 7413d0b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
default_install_hook_types: [pre-commit, pre-push]
2+
default_install_hook_types: [pre-commit, pre-push, commit-msg]
33
default_stages: [pre-commit]
44
minimum_pre_commit_version: 3.0.0
55
repos:

commitlint.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat', // New feature
9+
'fix', // Bug fix
10+
'docs', // Documentation changes
11+
'style', // Code style changes (formatting, etc)
12+
'refactor', // Code refactoring
13+
'perf', // Performance improvements
14+
'test', // Adding or updating tests
15+
'chore', // Maintenance tasks
16+
'ci', // CI/CD changes
17+
'build', // Build system changes
18+
'revert', // Reverting changes
19+
],
20+
],
21+
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
22+
'subject-empty': [2, 'never'],
23+
'subject-full-stop': [2, 'never', '.'],
24+
'type-empty': [2, 'never'],
25+
'type-case': [2, 'always', 'lower-case'],
26+
},
27+
};

0 commit comments

Comments
 (0)