-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add commitlint and husky (#128)
Change CONTRIBUTING.md Resolves #117 Signed-off-by: Olivier Albertini <[email protected]>
- Loading branch information
1 parent
02a2001
commit 44214ac
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extends: | ||
- '@commitlint/config-conventional' | ||
rules: | ||
header-max-length: [1, 'always', 72] | ||
type-enum: | ||
- 2 | ||
- always | ||
- - ci | ||
- feat | ||
- fix | ||
- docs | ||
- style | ||
- refactor | ||
- perf | ||
- test | ||
- revert | ||
- chore | ||
help: | | ||
**Possible types**: | ||
`ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle CI, BrowserStack, SauceLabs) | ||
`feat`: Adds a new feature. | ||
`fix`: Solves a bug. | ||
`docs`: Adds or alters documentation. (example scopes: readme, worker, code_of_conduct, contributors) | ||
`style`: Improves formatting, white-space. | ||
`refactor`: Rewrites code without feature, performance or bug changes. | ||
`perf`: Improves performance. | ||
`test`: Adds or modifies tests. (example scopes: functionals, unit-tests) | ||
`revert`: Changes that reverting other changes | ||
`chore`: No production code change. Updating grunt tasks etc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,17 @@ Please read project contribution | |
[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md) | ||
for general practices for OpenTelemetry project. | ||
|
||
#### Conventional commit | ||
|
||
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages. You can see examples [here](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#examples). | ||
We use [commitlint](https://github.com/conventional-changelog/commitlint) and [husky](https://github.com/typicode/husky) to prevent bad commit message. | ||
For example, you want to submit the following commit message `git commit -s -am "my bad commit"`. | ||
You will receive the following error : | ||
``` | ||
✖ type must be one of [ci, feat, fix, docs, style, refactor, perf, test, revert, chore] [type-enum] | ||
``` | ||
Here an exemple that will pass the verification: `git commit -s -am "chore(opentelemetry-core): update deps"` | ||
|
||
### Fork | ||
|
||
In the interest of keeping this repository clean and manageable, you should work from a fork. To create a fork, click the 'Fork' button at the top of the repository, then clone the fork locally using `git clone [email protected]:USERNAME/opentelemetry-js.git`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters