Skip to content

chore: add commitlint checks for commits and PR titles#4

Merged
mandaiy merged 3 commits intomainfrom
chore/commitlint-pr-title-and-hooks
Feb 23, 2026
Merged

chore: add commitlint checks for commits and PR titles#4
mandaiy merged 3 commits intomainfrom
chore/commitlint-pr-title-and-hooks

Conversation

@mandaiy
Copy link
Owner

@mandaiy mandaiy commented Feb 23, 2026

Summary

Add commitlint enforcement for commit messages and PR titles to support squash-merge workflow.

Changes

  • Added commitlint.config.cjs with Conventional Commits rules.
  • Added commitlint commit-msg hook to .pre-commit-config.yaml.
  • Integrated PR title lint job into .github/workflows/ci.yml.
  • Updated docs in docs/repository_structure.md and docs/pull_request_template.md.
  • Excluded Markdown files from trailing-whitespace pre-commit hook.

Testing

  • make format
  • make lint
  • make test

Checklist

  • I updated relevant documentation under docs/.
  • PR title follows Conventional Commits (e.g., feat: ..., fix: ...).
  • I verified that the changes are backward compatible, or documented breaking changes.
  • I confirmed this PR is ready for review.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4f48e0e72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +21 to +22
- name: Lint PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

Choose a reason for hiding this comment

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

P1 Badge Load repository config before running PR title lint

The lint-pr-title job runs npx commitlint without ever checking out the repository, so commitlint.config.cjs is not present in that job’s workspace and the PR title is not validated against this repo’s configured Conventional Commits rules (and can fail outright depending on commitlint defaults). This affects every PR event handled by this workflow.

Useful? React with 👍 / 👎.

Comment on lines +19 to +22
- id: commitlint
name: commitlint (commit message)
entry: npx --no -- commitlint --edit
language: system

Choose a reason for hiding this comment

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

P1 Badge Provision commitlint packages in commit-msg hook

The new commit-msg hook invokes npx ... commitlint --edit via language: system, but the repository does not declare Node dependencies and commitlint.config.cjs extends @commitlint/config-conventional; on a clean machine this hook depends on globally preinstalled packages and will fail for contributors who only installed the repo’s Python toolchain. This makes normal commits fail in common local setups.

Useful? React with 👍 / 👎.

@mandaiy mandaiy merged commit d60d728 into main Feb 23, 2026
2 checks passed
@mandaiy mandaiy deleted the chore/commitlint-pr-title-and-hooks branch February 23, 2026 02:11
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.

1 participant