mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 15:44:49 +02:00
docs: add git commit message convention
This commit is contained in:
58
.github/COMMIT_CONVENTION.md
vendored
Normal file
58
.github/COMMIT_CONVENTION.md
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Git Commit Message Convention
|
||||
We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history.
|
||||
|
||||
## Commit Message Format
|
||||
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
|
||||
format that includes a **type**, a **scope** and a **subject**:
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
The **header** is mandatory and the **scope** of the header is optional.
|
||||
|
||||
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
|
||||
to read on GitHub as well as in various git tools.
|
||||
|
||||
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
|
||||
|
||||
Samples: (even more [samples](https://github.com/flextype/flextype/commits/dev))
|
||||
|
||||
### 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
|
||||
The type of the made changes. Should be one of:
|
||||
* **feat** - some feature development
|
||||
* **fix** - bug fix
|
||||
* **docs** - changes in documentation
|
||||
* **style** - changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
* **perf**: A code change that improves performance
|
||||
* **refactor** - changes those do not fix a bug or implement a feature. Simple refactoring
|
||||
* **test** - adding missing tests or correcting existing tests
|
||||
* **chore** - any other changes, not affecting code
|
||||
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||
|
||||
### Scope
|
||||
The scope could be anything specifying the place of the commit change. For example core, admin-plugin, translation etc...
|
||||
|
||||
### Subject
|
||||
The subject contains a succinct description of the change:
|
||||
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* don't capitalize the first letter
|
||||
* no dot (.) at the end
|
||||
|
||||
### Body
|
||||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||
The body should include the motivation for the change and contrast this with previous behavior.
|
||||
|
||||
### Footer
|
||||
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.
|
Reference in New Issue
Block a user