hooks/conventional-commits
Commit messages are checked
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | any |
| Scope | root |
| Kind | outcome |
| Source | library v0.8.0 |
| Selected by | fleetlint-recommended@v0.8.0 |
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).
A finding that names no file points at the first existing file of .pre-commit-config.yaml, lefthook.yml, lefthook.yaml, lefthook.toml, lefthook.json, lefthook.jsonc, .lefthook.yml, .lefthook.yaml, .lefthook.toml, .lefthook.json or .lefthook.jsonc, else .pre-commit-config.yaml.
Sources
- https://www.conventionalcommits.org/en/v1.0.0/ (standard, Specification)
- https://pre-commit.com/ (spec, Confining hooks to run at certain stages)
- https://fleetlint.org/baseline/#git-hooks
Generated by fleetlint docs from catalog v0.8.0.