Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ packages/**/node_modules

# dist
dist
packages/**/dist
packages/**/dist

# NPM
package-lock.json
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# commitlint-wizardoc
Constraint rules that apply to the commit message for Wizardoc projects.
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.

## Usage
If you have never used commitlint before, you can visit [commitlint document](https://commitlint.js.org/) for more detail.

### Install
You can install `commitlint-wizardoc` using NPM and YARN as well.

```shell
# NPM
npm i commitlint-wizardoc -D

# YARN
yarn add commitlint-wizardoc -D
```

### Configuration
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.

For instance, create `.commitlintrc.js` that looks like:

```js
module.exports = {
// This line config will read the NPM package named "commitlint-config-wizardoc", so please make sure you have installed it before config this line.
extends: 'wizardoc'
}
```

Now, that's all you need to do.

## Convention
The commit message should consists of four parts:
```
![Feat::scope] some sentence
^ ^ ^ ^
| | | |
| | | |
| | | |- Subject(required)
| | |
| | |- Scope(optional)
| |
| |- Type(required)
|
|- Break change symbol(optional)
```

- `Break change symbol`: it can indicate that the commit contains break change
- `Type`: commit type that can only be one of the following types
- Feat
- Init
- Remove
- Delete
- Update
- Refactor
- Move
- New
- Add
- Patch
- Fix
- Test
- Stub
- Chore
- `Scope`: scope of modification
- `Subject`: description of the commit

## Override configs
You can also override `Wizardoc` config to create your own configuration as well.

```js
module.exports = {
extends: 'wizardoc',
rules: [
// Set the $ as the third parameter if you wanna change break symbol to $
"break-change-prefix": [2, "always", '$'],
]
}
```

## LiCENSE
MIT.