Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 3.3 KB

File metadata and controls

85 lines (67 loc) · 3.3 KB

Conventional Commits

This repo uses Conventional Commits to standardize the format of commit messages. This enables the automation of versioning and the generation of changelogs and release notes.

We follow the standard commit types (feat, fix, docs, style, refactor, etc.) and additionally use a custom infra type for infrastructure changes such as GitHub settings, Terraform configurations, and other DevOps-related changes.

Basic Structure

Visit the website for more details about the format; but essentially, commit messages should follow this pattern:

type[(scope)][!]: description

[body]

[footer(s)]

The type and description are the only two required components; but here's a quick explanation of all of them:

  • type - (Required) One of the following values:
    • build - A change that affects the build system or external dependencies
    • chore - A routine task, maintenance, etc., that doesn't change production code
    • ci - A change to CI configuration files or scripts
    • docs - A documentation-only change
    • feat - A new feature for the user or a significant enhancement
    • fix - A bug fix
    • infra - A change to infrastructure code (Terraform, GitHub settings, DevOps, etc.)
    • perf - A code change that improves performance
    • refactor - A code change that neither fixes a bug nor adds a feature
    • revert - Reverts a previous commit
    • style - A change that does not affect code behavior (formatting, spacing)
    • test - Adding or correcting tests
  • (scope) - (Optional) In parentheses, indicates the section of the codebase affected (e.g., ui, api, auth)
  • ! - (Optional) Indicates a breaking change (alternative to using BREAKING CHANGE: in the footer)
  • description - (Required) A concise, single-line description of the changes in imperative, present tense (use "change," not "changed," "changes," or "changing")
  • body - (Optional) Provides additional contextual information about the changes, explaining motivation, reasoning, or notable implementation details
  • footer(s) - (Optional) References to issues, PRs, or other metadata
    • BREAKING CHANGE: - Special footer indicating a breaking change, with a description of the change and migration notes

Commit Message Template

To facilitate all this, a default Git message template is included in the project. You can activate it by running the following command from the repo root:

git config commit.template .gitmessage

Afterward, whenever you run git commit (without the -m switch), the template should be displayed in your configured text editor. Other Git tooling should pick it up as well. Simply replace the template with your formatted commit message and save it.

Additional Information

If you're new to or unfamiliar with Conventional Commits, there are several good cheat sheets out there that can help you get familiar with it: