Semantic commits
Format
type(scope): brief descriptionThe scope is optional. The description starts lowercase, no period at the end.
Types
| Type | When to use | Example |
|---|---|---|
feat | New feature | feat(auth): add JWT validation |
fix | Bug fix | fix(api): handle null pointer in user endpoint |
docs | Documentation only | docs(readme): update installation steps |
style | Formatting, no logic change | style(login): fix button alignment |
refactor | Code change that doesn't fix or add | refactor(utils): extract common functions |
test | Adding or updating tests | test(auth): add login validation tests |
chore | Maintenance, deps, tooling | chore(deps): update dependencies |
Rules
- One type per commit. If a commit does two things, split it.
- Keep the description under 72 characters.
- Use the imperative mood: "add" not "added", "fix" not "fixed".
- The scope should name the module, component, or area of the codebase.