-
Notifications
You must be signed in to change notification settings - Fork 60
Add precommit hooks to only accept conventional commits #600
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
User story
As a maintainer or contributor to this repository,
I want Git pre-commit tooling that rejects commits whose messages do not follow Conventional Commits,
So that the history stays consistent with the project’s documented Git workflow and automated tooling (changelog, releases, CI) can rely on predictable commit messages.
Context
The project documents Conventional Commits in contributor guidance (e.g. type(scope): description). Today there is no automated guard at commit time, so invalid messages can slip in until CI or review.
Acceptance criteria
- Configuration in-repo — A single, version-controlled YAML configuration (e.g. pre-commit
.pre-commit-config.yaml) defines hooks, including validation of commit messages for Conventional Commits. - Commit message gate — Pushing a commit is blocked if the commit message does not match the agreed Conventional Commit pattern (types such as
feat,fix,docs, etc., with optional scope and description), except where explicitly allowed (e.g. merge commits, if the team chooses to exempt them). - Developer setup — Documentation explains how to install the hook manager locally (
pre-commit installand, if needed,pre-commit install --hook-type commit-msg) so new contributors can opt in without guessing. - CI alignment (optional but recommended) — The same checks can be run in CI (e.g.
pre-commit run --all-filesand/or commit-msg validation in a workflow) so forks and contributors without local hooks still get feedback.
Out of scope (unless expanded later)
- Replacing or duplicating existing Maven quality gates (Spotless, tests, etc.) unless explicitly added as separate hooks in the same initiative.
References
- Conventional Commits specification
- pre-commit framework
- Example commit-msg validators:
compilerla/conventional-pre-commitor equivalent
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request