hooks/conventional-commits
Commit messages are checked
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | any |
| Scope | root |
| Kind | outcome |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
A commit-msg hook checks every message: a pre-commit/prek hook at stage commit-msg or a known message linter (conventional-pre-commit, commitizen, commitlint, gitlint, cocogitto), or a command in lefthook’s commit-msg. Which convention it enforces is not checked.
Why
The changelog and version bump are generated from commit types; one bad message breaks both.
Applies when
[".pre-commit-config.yaml", "lefthook.yml", "lefthook.yaml", "lefthook.toml", "lefthook.json", "lefthook.jsonc",
".lefthook.yml", ".lefthook.yaml", ".lefthook.toml", ".lefthook.json", ".lefthook.jsonc"].exists(f, file(f))Fix
Add the conventional-pre-commit hook with stages: [commit-msg] (lefthook: a commit-msg command running commitlint or cog verify).
Agent instruction: Add compilerla/conventional-pre-commit to .pre-commit-config.yaml with stages: [commit-msg] and the allowed types (feat, fix, refactor, perf, test, docs, build, ci, style, chore, revert).
See: https://fleetlint.org/baseline/#git-hooks
Generated by fleetlint docs from catalog v0.3.1.