Skip to content

Semantic commits

Format

type(scope): brief description

The scope is optional. The description starts lowercase, no period at the end.

Types

TypeWhen to useExample
featNew featurefeat(auth): add JWT validation
fixBug fixfix(api): handle null pointer in user endpoint
docsDocumentation onlydocs(readme): update installation steps
styleFormatting, no logic changestyle(login): fix button alignment
refactorCode change that doesn't fix or addrefactor(utils): extract common functions
testAdding or updating teststest(auth): add login validation tests
choreMaintenance, deps, toolingchore(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.