Conventional Commits
Syntax
TYPE(OPTIONAL_SCOPE): DESCRIPTION
OPTIONAL_BODY
OPTIONAL_FOOTER
-
A commit body is free-form and MAY consist of any number of newline separated paragraphs.
-
Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the footer. Breaking changes are indicated in the prefix of a commit by adding a
!before the colon. -
If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and description, e.g.:
BREAKING CHANGE: environment variables now take precedence over config files.
TYPES
| TYPES | Description |
|---|---|
| feat | MUST be used when a commit adds a new feature to your application or library |
| fix | MUST be used when a commit represents a bug fix for your application |
| tests | Changes to tests |
| revert | Revert of a previous commit |
| docs | Documentation |
| style | Formatting and white space changes |
| perf | Performance improvements |
| build | Build system or external dependency changes |
| ci | CI changes |
| chore | Miscellaneous changes that don’t modify source code or tests |
| refactor | A code change that does not fix a bug or add a feature |
RFC2119 verbs
-
MUST This word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.
-
MUST NOT This phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.
-
SHOULD This word, or the adjective “RECOMMENDED”, mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
-
SHOULD NOT This phrase, or the phrase “NOT RECOMMENDED” mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.
-
MAY This word, or the adjective “OPTIONAL”, mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option MUST be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides.)