Skip to content

Add precommit hooks to only accept conventional commits #600

@jabrena

Description

@jabrena

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

  1. 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.
  2. 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).
  3. Developer setup — Documentation explains how to install the hook manager locally (pre-commit install and, if needed, pre-commit install --hook-type commit-msg) so new contributors can opt in without guessing.
  4. CI alignment (optional but recommended) — The same checks can be run in CI (e.g. pre-commit run --all-files and/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions