Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rak3rman/ddea632f1b006efff0ec613e55d59756 to your computer and use it in GitHub Desktop.
Save rak3rman/ddea632f1b006efff0ec613e55d59756 to your computer and use it in GitHub Desktop.
Semantic Commit Messages

Semantic Commit Messages

A method to make your commit messages crystal clear and information dense.

Syntax

[ticket] (<scope>) <type>: <subject>
  • <ticket>: optional, ticket slug in project management tool
  • <scope>: optional, high-level context like app or package name
  • <type>: see details for type choice below
  • <description>: commit message, what was accomplished

Example

Basic Format

[EX-1] (frontend) feat: add hat wobble
^----^ ^--------^ ^---^ ^------------^
|      |          |     |
|      |          |     +-> description: summary in present tense
|      |          +-> type: chore, docs, feat, fix, refactor, style, or test
|      +-> scope: app, package name, or subcomponent, like frontend, backend, web-scraper
+-> ticket: referenced ticket slug if it exists, typically of the form <PROJECT>-<ID#>

Applied Examples

Note: trailing (#...) is the Github PR issue number.

  • [SW-154] (multimeter-probe) feat: reworked parsing extraction stats to report CER metrics (#163)
  • [SW-234] (infra) feat: setup automated postgres-core db backups (#248)
  • [ENG-243] (hono) feat: enabled dev auth middleware override on backend (#157)

Type Details

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)
  • revert: (reverts to a previous commit)

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment