Conventional Commits
What are Conventional Commits?
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history, which makes it easier to write automated tools on top of.
cargo-commitlint enforces this specification to ensure consistent, meaningful commit messages across your project.
Format
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]Components
- type: The type of change (feat, fix, docs, etc.)
- scope: Optional scope indicating what part of the codebase is affected
- description: A short description of the change
- body: Optional longer description
- footer: Optional footer for breaking changes or issue references
Commit Types
feat
A new feature. Introduces new functionality to the codebase.
feat: add user authenticationfix
A bug fix. Fixes a problem in existing functionality.
fix: resolve memory leak in parserdocs
Documentation only changes. No code changes.
docs: update API documentationstyle
Changes that do not affect the meaning of the code (formatting, missing semicolons, etc.)
style: format code with rustfmtrefactor
A code change that neither fixes a bug nor adds a feature.
refactor: simplify error handlingperf
A code change that improves performance.
perf: optimize database queriestest
Adding missing tests or correcting existing tests.
test: add unit tests for parserbuild
Changes that affect the build system or external dependencies.
build: update Cargo.toml dependenciesci
Changes to CI configuration files and scripts.
ci: add GitHub Actions workflowchore
Other changes that don't modify src or test files.
chore: update .gitignorerevert
Reverts a previous commit.
revert: revert "feat: add feature"Breaking Changes
Breaking changes can be indicated in two ways:
- Add a
!after the type/scope:feat!: breaking change - Add
BREAKING CHANGE:in the footer
feat!: remove deprecated API
BREAKING CHANGE: The old API has been removed.
Use the new API instead.