|
1 | 1 | # commitlint-wizardoc |
2 | | -Constraint rules that apply to the commit message for Wizardoc projects. |
| 2 | +commitlint-wizardoc is a configuration package for [commitlint](https://github.com/conventional-changelog/commitlint) that contain some rules and plugins to check that your commit message conform to the `Wizardoc` convention. |
| 3 | + |
| 4 | +## Usage |
| 5 | +If you have never used commitlint before, you can visit [commitlint document](https://commitlint.js.org/) for more detail. |
| 6 | + |
| 7 | +### Install |
| 8 | +You can install `commitlint-wizardoc` using NPM and YARN as well. |
| 9 | + |
| 10 | +```shell |
| 11 | +# NPM |
| 12 | +npm i commitlint-wizardoc -D |
| 13 | + |
| 14 | +# YARN |
| 15 | +yarn add commitlint-wizardoc -D |
| 16 | +``` |
| 17 | + |
| 18 | +### Configuration |
| 19 | +Create a [commitlint](https://github.com/conventional-changelog/commitlint) config in the root path of your project, and you can extends the `wizardoc` config to do all configuration work. |
| 20 | + |
| 21 | +For instance, create `.commitlintrc.js` that looks like: |
| 22 | + |
| 23 | +```js |
| 24 | +module.exports = { |
| 25 | + // This line config will read the NPM package named "commitlint-config-wizardoc", so please make sure you have installed it before config this line. |
| 26 | + extends: 'wizardoc' |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +Now, that's all you need to do. |
| 31 | + |
| 32 | +## Convention |
| 33 | +The commit message should consists of four parts: |
| 34 | +``` |
| 35 | +![Feat::scope] some sentence |
| 36 | +^ ^ ^ ^ |
| 37 | +| | | | |
| 38 | +| | | | |
| 39 | +| | | |- Subject(required) |
| 40 | +| | | |
| 41 | +| | |- Scope(optional) |
| 42 | +| | |
| 43 | +| |- Type(required) |
| 44 | +| |
| 45 | +|- Break change symbol(optional) |
| 46 | +``` |
| 47 | + |
| 48 | +- `Break change symbol`: it can indicate that the commit contains break change |
| 49 | +- `Type`: commit type that can only be one of the following types |
| 50 | + - Feat |
| 51 | + - Init |
| 52 | + - Remove |
| 53 | + - Delete |
| 54 | + - Update |
| 55 | + - Refactor |
| 56 | + - Move |
| 57 | + - New |
| 58 | + - Add |
| 59 | + - Patch |
| 60 | + - Fix |
| 61 | + - Test |
| 62 | + - Stub |
| 63 | + - Chore |
| 64 | +- `Scope`: scope of modification |
| 65 | +- `Subject`: description of the commit |
| 66 | + |
| 67 | +## Override configs |
| 68 | +You can also override `Wizardoc` config to create your own configuration as well. |
| 69 | + |
| 70 | +```js |
| 71 | +module.exports = { |
| 72 | + extends: 'wizardoc', |
| 73 | + rules: [ |
| 74 | + // Set the $ as the third parameter if you wanna change break symbol to $ |
| 75 | + "break-change-prefix": [2, "always", '$'], |
| 76 | + ] |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +## LiCENSE |
| 81 | +MIT. |
0 commit comments