Skip to content

Commit 9e83429

Browse files
committed
docs: update readme
1 parent ba9315a commit 9e83429

File tree

1 file changed

+77
-28
lines changed

1 file changed

+77
-28
lines changed

readme.md

Lines changed: 77 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
> Lint commit messages against your conventional-changelog ruleset and preset
22
33
# conventional-changelog-lint
4-
Lint your commit messages against defined rulesets. ` conventional-changelog-lint` plays nice with `conventional-changelog` and takes cues from `eslint`, e.g. shareable configurations.
4+
5+
Lint your commit messages against defined rulesets.
6+
`conventional-changelog-lint` plays nice with `conventional-changelog`
7+
and takes cues from `eslint`, e.g. shareable configurations.
58

69
## Installation
10+
711
Fetch it with `npm`
12+
813
```shell
914
npm install --save-dev conventional-changelog-lint
1015
```
1116

1217
## Usage
18+
1319
`conventional-changelog-lint` provides a command line and node interface.
20+
1421
### CLI
15-
The command line interface reads `.conventional-changelog-lintrc` resolves `extends` configurations.
22+
23+
![conventional-changelog-lint demo](https://git.io/v2iTI)
24+
25+
The command line interface reads `.conventional-changelog-lintrc`
26+
resolves `extends` configurations.
27+
1628
```shell
1729
❯ conventional-changelog-lint --help
1830
[email protected] - Lint commit messages against a conventional-changelog preset and ruleset
@@ -28,27 +40,11 @@ The command line interface reads `.conventional-changelog-lintrc` resolves `exte
2840

2941
```
3042
31-
#### Recipes
32-
* As a git `commitmsg` hook with husky
33-
```json
34-
{
35-
"scripts": {
36-
"commitmsg": "conventional-changelog-lint -e"
37-
}
38-
}
39-
```
43+
### API
4044
41-
* As part of `npm test`
42-
```json
43-
{
44-
"scripts": {
45-
"test": "conventional-changelog --from=HEAD~1"
46-
}
47-
}
48-
```
45+
The programming interface does not read configuration by default,
46+
it has to be provided as second parameter.
4947
50-
### API
51-
The programming interface does not read configuration by default, it has to be provided as second parameter.
5248
```js
5349
import lint from 'conventional-changelog-lint';
5450
const report = lint(
@@ -60,7 +56,9 @@ const report = lint(
6056
);
6157
```
6258
63-
To achieve the same behavior as with the command line interface you can use the provided utility functions:
59+
To achieve the same behavior as with the command line interface
60+
you can use the provided utility functions:
61+
6462
```js
6563
import lint from 'conventional-changelog-lint';
6664
import {
@@ -77,32 +75,72 @@ const report = lint(
7775
);
7876
```
7977
78+
### Recipes
79+
80+
* As a git `commitmsg` hook with husky
81+
82+
```json
83+
{
84+
"scripts": {
85+
"commitmsg": "conventional-changelog-lint -e"
86+
}
87+
}
88+
```
89+
90+
* As part of `npm test`
91+
92+
```json
93+
{
94+
"scripts": {
95+
"test": "conventional-changelog --from=HEAD~1"
96+
}
97+
}
98+
```
99+
80100
## Configuration
81-
`conventional-changelog-lint` allows detailed configuration via `.conventional-changelog-lintrc` and shareable configuration. By default it will use the [angular](https://github.com/marionebl/conventional-changelog-lint-config-angular#rules) shareable config. See the documentation there for default rules.
101+
102+
`conventional-changelog-lint` allows detailed configuration via
103+
`.conventional-changelog-lintrc` and shareable configuration.
104+
By default it will use the
105+
[angular](https://github.com/marionebl/conventional-changelog-lint-config-angular#rules)
106+
shareable config.
107+
See the documentation there for default rules.
82108
83109
### extends
110+
84111
```js
85112
{
86113
"extends": ["angular"]
87114
}
88115
```
89-
Array of shareable configurations to extend. Configurations are resolved as `conventional-changelog-lint-config-${name}` and have to be installed. See [npm search](https://www.npmjs.com/search?q=conventional-changelog-lint-config) for available shareable configurations.
116+
117+
Array of shareable configurations to extend.
118+
Configurations are resolved as `conventional-changelog-lint-config-${name}`
119+
and have to be installed.
120+
See [npm search](https://www.npmjs.com/search?q=conventional-changelog-lint-config)
121+
for available shareable configurations.
90122
91123
---
124+
92125
⇨ See [shareable-config](./documentation/shareable-config.md) for details
93126
94127
### preset
128+
95129
```js
96130
{
97131
"preset": "angular"
98132
}
99133
```
134+
100135
`conventional-changelog` preset name to use for parsing of commit messages.
101136
102137
---
103-
⇨ See [conventional-changelog](https://github.com/ajoslin/conventional-changelog#preset) for details
138+
139+
⇨ See [conventional-changelog](https://github.com/ajoslin/conventional-changelog#preset)
140+
for details
104141
105142
### rules
143+
106144
```js
107145
{
108146
"rules": {
@@ -112,12 +150,21 @@ Array of shareable configurations to extend. Configurations are resolved as `con
112150
}
113151
}
114152
```
115-
Rules applicable to the linted commit messages. By default all rules are disabled via a level of 0. They can be enabled by shareable configuration, such as the [angular config](/marionebl/conventional-changelog-lint-config-angular), which is loaded by default.
153+
Rules applicable to the linted commit messages.
154+
By default all rules are disabled via a level of 0.
155+
They can be enabled by shareable configuration,
156+
such as the
157+
[angular config](https://github.com/marionebl/conventional-changelog-lint-config-angular),
158+
which is loaded by default.
116159
117160
---
161+
118162
⇨ See [rules](./documentation/rules.md) for details
119163
120164
### wildcards
165+
166+
Patterns to exclude from linting
167+
121168
```js
122169
wildcards: {
123170
merge: [
@@ -131,7 +178,9 @@ wildcards: {
131178
]
132179
}
133180
```
134-
Patterns to exclude from linting
135181
136182
---
137-
Copyright 2016 by [Mario Nebl](https://github.com/marionebl) and [contributors](./graphs/contributors). Released under the [MIT license]('./license.md').
183+
184+
Copyright 2016 by [Mario Nebl](https://github.com/marionebl)
185+
and [contributors](./graphs/contributors).
186+
Released under the [MIT license]('./license.md').

0 commit comments

Comments
 (0)