Commit Message Format
Invoice OCR follows the Conventional Commits specification for clear and structured commit messages.Basic Structure
Rules
- Messages should be clear and scoped
- Use lowercase for the description
- No period at the end of the description
- Keep the first line under 72 characters
- Use the imperative mood (“add” not “added” or “adds”)
Commit Types
feat: New Features
Use for new functionality or capabilities:
fix: Bug Fixes
Use for fixing bugs or errors:
docs: Documentation
Use for documentation-only changes:
refactor: Code Restructuring
Use for code changes that don’t add features or fix bugs:
test: Tests
Use for adding or modifying tests:
chore: Maintenance
Use for build process, dependencies, or tooling changes:
style: Code Style
Use for formatting, whitespace, or style changes (no code logic change):
perf: Performance
Use for performance improvements:
Examples from Invoice OCR
Here are real examples from the project:Feature Addition
Bug Fix
Documentation
Refactoring
Testing
Multi-line Commits
For complex changes, use the body and footer:Body Guidelines
- Separate from the subject with a blank line
- Explain what and why, not how
- Wrap lines at 72 characters
- Use bullet points for multiple points
Footer Guidelines
- Reference issues or PRs (e.g., “Closes #123”, “Fixes #456”)
- Note breaking changes with
BREAKING CHANGE: - Add co-authors with
Co-authored-by:
Breaking Changes
For changes that break backward compatibility:! after the type to indicate a breaking change.
Scope (Optional)
You can add a scope to provide more context:api- API routesui- User interface componentslib- Business logic and utilitiesreconciliation- Invoice reconciliation engineconfig- Configuration filesdeps- Dependencies
Tools and Automation
Commitlint (Optional)
Consider using commitlint to enforce commit conventions:Husky (Optional)
Use Husky to run checks before commits:Quick Reference
| Type | Description | Example |
|---|---|---|
feat: | New feature | feat: add PDF support |
fix: | Bug fix | fix: handle missing API key |
docs: | Documentation | docs: update README |
refactor: | Code restructuring | refactor: simplify reconciliation |
test: | Tests | test: add coverage for edge cases |
chore: | Maintenance | chore: update dependencies |
style: | Formatting | style: fix indentation |
perf: | Performance | perf: optimize image processing |
Best Practices
- Be specific: “fix: handle null values in line items” vs “fix: bug fix”
- One purpose per commit: Don’t mix features and fixes
- Test before committing: Ensure code works and passes linting
- Reference issues: Link to GitHub issues when applicable
- Keep it simple: Clear messages are better than clever ones
Related Guidelines
- See Code Style Guide for coding standards
- See Contributing Guidelines for PR process
