Skip to content

feat: enforce conventional commits - #238

Merged
AnnoDomine merged 8 commits into
danieldeer:chore/contributor-workflow-and-docsfrom
AnnoDomine:feat/enforce-conventional-commits
Sep 19, 2026
Merged

AnnoDomine merged 8 commits into
danieldeer:chore/contributor-workflow-and-docsfrom
AnnoDomine:feat/enforce-conventional-commits

Conversation

@AnnoDomine

@AnnoDomine AnnoDomine commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description

Configures and enforces pre-commit hooks for code quality and Conventional Commits 1.0.0 validation. Developers can now initialize the entire dev environment and hook setup in a single command using uv run pre-commit install.

Additional it includes the CI action for semantic pull request title, to enforce the PR titel follows the conventional commits for more easy merge of PRs.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Key Changes

  • Pre-commit Setup: Expand .pre-commit-config.yaml with default_install_hook_types configured for pre-commit and commit-msg.
  • Commit Validation: Integrated hook to enforce Conventional Commits 1.0.0 on all commit messages.
  • Dependency Management: Added pre-commit to dev dependencies in pyproject.toml managed by uv.
  • Documentation: Updated contributing guidelines with Commit Message Guidelines (format reference, types, body rules, examples) and onboarding instructions (uv run pre-commit install).

Validation

  1. Hook Installation:
    • Ran uv run pre-commit install in a clean environment.
    • Verified that .git/hooks/pre-commit and .git/hooks/commit-msg were successfully created.
  2. Commit Message Validation:
    • Tested invalid commit message: git commit -m "bad commit message" $\rightarrow$ Rejected as expected.
    • Tested valid Conventional Commit: git commit -m "docs: update contributing guide" $\rightarrow$ Passed successfully.
  3. Pre-commit Checks:
    • Executed uv run pre-commit run --all-files $\rightarrow$ All hooks passed.
git commit -S -m "bla bla "
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to XXXXXXXXXXXXXXXXXXXXXX.
ty.......................................................................Passed
pytest...................................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
[INFO] Restored changes from XXXXXXXXXXXXXXXXXXXXXX.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to XXXXXXXXXXXXXXXXXXXXXX.
Conventional Commit......................................................Failed
- hook id: conventional-pre-commit
- exit code: 1

[Bad commit message] >> bla bla
Your commit message does not follow Conventional Commits formatting
https://www.conventionalcommits.org/
git commit -S -m "docs(guideline): added setup command and adjust branch policy in guidelines"
uv-lock..............................................(no files to check)Skipped
ty.......................................................................Passed
pytest...................................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
uv-lock..............................................(no files to check)Skipped
Conventional Commit......................................................Passed

Checklist

  • I reviewed the diff and kept it focused on the described change.
  • Python changes pass uv run ruff check . and uv run ruff format --check ., or this PR does not change Python.
  • Changed behavior is covered by appropriate tests, including a regression test for bug fixes; any limitations are explained under Validation.
  • Validation lists the checks or manual flows I ran and their results.
  • Relevant documentation is updated, or no documentation change is needed.

Closes: #236

@AnnoDomine AnnoDomine linked an issue Sep 18, 2026 that may be closed by this pull request
@AnnoDomine
AnnoDomine changed the base branch from development to chore/contributor-workflow-and-docs September 18, 2026 17:31
@AnnoDomine
AnnoDomine requested a review from mattsva September 18, 2026 18:01
@AnnoDomine
AnnoDomine marked this pull request as draft September 18, 2026 18:42
@AnnoDomine
AnnoDomine marked this pull request as ready for review September 18, 2026 18:44
@AnnoDomine AnnoDomine changed the title Feat/enforce conventional commits feat: enforce conventional commits Sep 18, 2026
Comment thread docs/contributing.md Outdated
AnnoDomine and others added 2 commits September 18, 2026 22:33
Co-authored-by: Mark van der Dam <39335084+MarkVDD@users.noreply.github.com>
@AnnoDomine
AnnoDomine requested review from Airbag65 and MarkVDD and removed request for MarkVDD and mattsva September 19, 2026 07:04

@Airbag65 Airbag65 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition @AnnoDomine!

@AnnoDomine
AnnoDomine merged commit 2cb18f2 into danieldeer:chore/contributor-workflow-and-docs Sep 19, 2026
4 checks passed
@mattsva

mattsva commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Thats greate. I love it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce Conventional Commits specification with pre-commit hook

4 participants