-
Notifications
You must be signed in to change notification settings - Fork 207
Conventional Commits
part of Coding Style
The commit headline (or "subject line") is the first line of the git commit comments, separated from the "body" by a blank line.
Try to keep this line below 80 characters, so it won't wrap when folks use git log --oneline
, but that's not a hard limit.
We use the Conventional Commits format for the headline. Automated tools use this information to determine what version number to use when releasing each package, and to assemble release notes.
In short, the subject line needs to be a keyword, followed by an optional package name (in parentheses), followed by an optional exclamation point, followed by a colon and space, followed by anything else you want. Some examples:
refactor(swingset): refactor GC code
-
fix(swingset)!: change buildRootObject API
. The!
marks this as a breaking change, incurring a larger version-number bump. For the@lerna/conventional-commits
tooling to recognize the breaking change, there must also be aBREAKING CHANGE: Description of what breaks.
in the body of the commit message, which will get incorporated in the generatedCHANGELOG.md
. fix(zoe): fix dropped-notification bug
feat(ERTP): add split payments
chore: upgrade test runner
build: update moddable for TextEncoder / TextDecoder integration
cosmos-sdk conventional-commit-types is another source of inspiration.
A CI job will check for adherence and complain if the format is not accepted. Some common errors are:
-
fix(zoe,ertp): update calling convention
(the package name field is not a list, and cannot contain commas) -
fix!(swingset): reload vats correctly
(an exclamation point, if any, must appear after the package name, immediately before the colon)
category: Coding Style