Skip to main content

Commit convention

Git Commit Message Convention

info

This is adapted from Angular's commit convention.

TL;DR:

Commit titles must match the following regex:

/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;

Full Message Format

A commit message consists of a header, body and footer. The header has a type, scope and subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

The header is mandatory and the scope of the header is optional.

Revert

If the commit reverts a previous commit, it should begin with revert:, followed by the header of the reverted commit. In the body, it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

Type

If the prefix is feat, fix or perf, it will appear in the changelog. However, if there is any BREAKING CHANGE, the commit will always appear in the changelog.

Other prefixes are up to your discretion. Suggested prefixes are docs, chore, style, refactor, and test for non-changelog related tasks.

Scope

The scope refers to which section of the application the changes took place in, such as SlashCommand, ContextMenu, or MessageComponents

Subject

The subject contains a succinct description of the change:

  • Use the imperative, present tense: "change", not "changed" nor "changes"
  • do not capitalize the first letter
  • do not end you message with a period (.)

Body

Like in the subject, use the imperative, present tense The body should include the motivation for the change and difference with the previous behavior.

The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.