You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+77-28Lines changed: 77 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,30 @@
1
1
> Lint commit messages against your conventional-changelog ruleset and preset
2
2
3
3
# 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.
The command line interface reads `.conventional-changelog-lintrc`
26
+
resolves `extends` configurations.
27
+
16
28
```shell
17
29
❯ conventional-changelog-lint --help
18
30
[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
28
40
29
41
```
30
42
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
40
44
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.
49
47
50
-
### API
51
-
The programming interface does not read configuration by default, it has to be provided as second parameter.
52
48
```js
53
49
import lint from 'conventional-changelog-lint';
54
50
const report = lint(
@@ -60,7 +56,9 @@ const report = lint(
60
56
);
61
57
```
62
58
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
+
64
62
```js
65
63
import lint from 'conventional-changelog-lint';
66
64
import {
@@ -77,32 +75,72 @@ const report = lint(
77
75
);
78
76
```
79
77
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
+
80
100
## 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.
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.
90
122
91
123
---
124
+
92
125
⇨ See [shareable-config](./documentation/shareable-config.md) for details
93
126
94
127
### preset
128
+
95
129
```js
96
130
{
97
131
"preset": "angular"
98
132
}
99
133
```
134
+
100
135
`conventional-changelog` preset name to use for parsing of commit messages.
101
136
102
137
---
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
104
141
105
142
### rules
143
+
106
144
```js
107
145
{
108
146
"rules": {
@@ -112,12 +150,21 @@ Array of shareable configurations to extend. Configurations are resolved as `con
112
150
}
113
151
}
114
152
```
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.
⇨ See [rules](./documentation/rules.md) for details
119
163
120
164
### wildcards
165
+
166
+
Patterns to exclude from linting
167
+
121
168
```js
122
169
wildcards: {
123
170
merge: [
@@ -131,7 +178,9 @@ wildcards: {
131
178
]
132
179
}
133
180
```
134
-
Patterns to exclude from linting
135
181
136
182
---
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)
0 commit comments