This project uses Conventional Commits to ensure consistent and meaningful commit messages that enable automated release notes generation.
<type>(<scope>): <Description>
[optional body]
[optional footer(s)]
| Type | Description | Release Impact |
|---|---|---|
feat |
New features | Minor version bump |
fix |
Bug fixes | Patch version bump |
perf |
Performance improvements | Patch version bump |
docs |
Documentation changes | No release |
ci |
CI/CD configuration changes | No release |
build |
Build system changes | No release |
test |
Adding or updating tests | No release |
refactor |
Code refactoring | No release |
style |
Code style changes (formatting, etc.) | No release |
chore |
Maintenance tasks | No release |
The scope is optional but recommended for clarity. Use lowercase and keep it concise:
auth- Authentication and authorizationdocker- Docker configuration and imagesapi- API endpoints and logicui- User interface componentsdatabase- Database schema and queriesrelease- Release and deployment processesdocs- Documentation
The description should be concise, using imperative mood (e.g., "Add", "Fix", "Update"). It should start with a capital letter and not end with a period.
For breaking changes, add ! after the type/scope or include BREAKING CHANGE: in the footer:
feat(api)!: redesign user authentication endpoints
BREAKING CHANGE: User authentication endpoints have been completely redesigned.
The old /auth/login endpoint has been replaced with /api/v2/auth/authenticate.Good commit messages:
feat(auth): Add user authentication system
fix(docker): Resolve container startup issue
docs(readme): Update installation instructions
ci(release): Add automated release workflow
perf(database): Optimize user query performance
test(auth): Add integration tests for login flowBad commit messages:
✗ Add feature # Missing type and scope
✗ Fix bug # Too vague, missing scope
✗ Update documentation # Missing conventional format
✗ WIP # Not descriptiveInstall Python >= 3.9 as a prerequisite.
Install pre-commit hooks for immediate feedback:
# Install pre-commit (one-time setup)
pip install pre-commit
# Install project hooks (run in project directory)
pre-commit install --config .pre-commit/.pre-commit-config.yaml
pre-commit install --hook-type commit-msg --config .pre-commit/.pre-commit-config.yaml
# Test the setup (optional)
pre-commit run --config .pre-commit/.pre-commit-config.yaml --all-filesIn rare cases, you can bypass pre-commit hooks:
# Skip all pre-commit hooks (use sparingly)
git commit --no-verify -m "emergency fix"Note: GitHub Actions will still validate these commits in PRs.
This project uses semantic-release for automated versioning and release notes. The release workflow is as follows:
- Feature development: Work on feature branches, squash merge to
develop - Release preparation: Cherry-pick commits from
developtorelease-vX.Y.Zbranch - Release: Create PR from
release-vX.Y.Ztomain - Automated release: Semantic-release generates version, tags, and release notes
For richer release notes, include detailed information in commit bodies:
feat(dashboard): Implement user analytics dashboard
* Real-time user activity metrics
* Customizable dashboard widgets
* Export functionality for reports
* Mobile-responsive designPre-commit hooks not running:
# Reinstall hooks
pre-commit uninstall --config .pre-commit/.pre-commit-config.yaml
pre-commit install --config .pre-commit/.pre-commit-config.yaml
# Verify installation
pre-commit --versionNode.js/npm errors with commitlint:
# Clear npm cache and reinstall
npm cache clean --force
pre-commit clean
pre-commit installPermission errors:
# Fix permissions (Unix/Linux/Mac)
chmod +x .git/hooks/pre-commit
chmod +x .git/hooks/commit-msgIf you have questions about the commit format or contribution process, please:
- Check the automated validation feedback in failed CI runs
- Review existing commits for examples
- Refer to Conventional Commits specification
- Open an issue for clarification