chore: add commitlint checks for commits and PR titles#4
Conversation
There was a problem hiding this comment.
💡 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".
| - name: Lint PR title | ||
| run: echo "${{ github.event.pull_request.title }}" | npx commitlint |
There was a problem hiding this comment.
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 👍 / 👎.
.pre-commit-config.yaml
Outdated
| - id: commitlint | ||
| name: commitlint (commit message) | ||
| entry: npx --no -- commitlint --edit | ||
| language: system |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Add commitlint enforcement for commit messages and PR titles to support squash-merge workflow.
Changes
commitlint.config.cjswith Conventional Commits rules.commit-msghook to.pre-commit-config.yaml..github/workflows/ci.yml.docs/repository_structure.mdanddocs/pull_request_template.md.trailing-whitespacepre-commit hook.Testing
make formatmake lintmake testChecklist
docs/.feat: ...,fix: ...).