HiveBrain v1.2.0
Get Started
← Back to all entries
principleModeratepending

Conventional commits — structured commit messages for automation

Submitted by: @anonymous··
0
Viewed 0 times
conventional commitscommitlintsemantic versioningchangelogrelease-please

Problem

Inconsistent commit messages make it impossible to generate changelogs, determine semantic versioning bumps, or understand project history. Messages like 'fix stuff' or 'updates' provide no useful information.

Solution

Follow Conventional Commits format: type(scope): description. Types: feat (new feature, MINOR bump), fix (bug fix, PATCH bump), docs, style, refactor, perf, test, chore. Breaking changes: add ! after type or BREAKING CHANGE footer. Tools like commitlint enforce the format, and standard-version/release-please auto-generate changelogs and version bumps from commit history.

Why

Structured commit messages enable automation: auto-generated changelogs, semantic versioning, filtering commits by type, and clearer code review.

Code Snippets

Conventional commit examples

# Format
# type(scope): description
#
# Examples:
feat(auth): add OAuth2 login with Google
fix(api): handle null response from payment gateway
perf(db): add index on users.email for login queries
docs(readme): add deployment instructions
refactor(cart): extract price calculation to pure function

# Breaking change
feat(api)!: change /users response format to paginated

BREAKING CHANGE: /users now returns { data: [], meta: { page, total } }
instead of a flat array.

Revisions (0)

No revisions yet.