-
Notifications
You must be signed in to change notification settings - Fork 0
/
commitlint.config.js
283 lines (253 loc) · 8.22 KB
/
commitlint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
// THANKS
// https://gitlab.com/thesmiley1/dotfiles-public/-/blob/2347efbe7c2e0dee37096f4481795b0a30f103d4/home/.config/commitlint/commitlint.config.js
// # Configuration
//
// `@commitlint/cli` picks up configuration from `./commitlint.config.js`.
//
// The file is expected
//
// * to contain valid JavaScript
// * export a configuration object
// * adhere to the schema outlined below
//
// ...
//
// <https://commitlint.js.org/#/reference-configuration?id=configuration>
module.exports = {
// ## Shareable configuration
//
// Every commitlint configuration can extend other commitlint configurations.
// Specify configurations to extend via the `.extends` key, using ids that can
// be resolved by the node resolve algorithm.
//
// This means installed npm packages and local files can be used.
//
// <https://commitlint.js.org/#/reference-configuration?id=shareable-configuration>
extends: [
'@commitlint/config-conventional',
],
// ## Rules
//
// Rules are made up by a name and a configuration array. The configuration
// array contains:
//
// * Level `[0..2]`: `0` disables the rule. For `1` it will be considered a
// warning for `2` an error.
// * Applicable `always|never`: `never` inverts the rule.
// * Value: value to use for this rule.
//
// Rule configurations are either of type `array` residing on a key with the
// rule's name as key on the rules `object` or of type function returning type
// `array` or `Promise<array>`. This means all of the following notations are
// supported.
//
// * Plain array
// * Function returning array
// * Async function returning array
// * Function returning a promise resolving to array
//
// <https://commitlint.js.org/#/reference-rules?id=rules>
rules: {
// ### body-leading-blank
//
// * condition: `body` begins with blank line
//
// <https://commitlint.js.org/#/reference-rules?id=body-leading-blank>
'body-leading-blank': [2, 'always', null],
// ### body-max-length
//
// * condition: `body` has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=body-max-length>
'body-max-length': [2, 'always', Infinity],
// ### body-max-line-length
//
// * condition: `body` lines has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=body-max-line-length>
'body-max-line-length': [2, 'always', 72],
// ### body-min-length
//
// * condition: `body` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=body-min-length>
'body-min-length': [2, 'always', 0],
// ### footer-leading-blank
//
// * condition: `footer` begins with blank line
//
// <https://commitlint.js.org/#/reference-rules?id=footer-leading-blank>
'footer-leading-blank': [2, 'always', null],
// ### footer-max-length
//
// * condition: `footer` has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=footer-max-length>
'footer-max-length': [2, 'always', Infinity],
// ### footer-max-line-length
//
// * condition: `footer` lines has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=footer-max-line-length>
'footer-max-line-length': [2, 'always', 72],
// ### footer-min-length
//
// * condition: `footer` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=footer-min-length>
'footer-min-length': [2, 'always', 0],
// ### header-case
//
// * condition: `header` is in case `value`
//
// #### NOTE
//
// This rule is disabled because it dupes `type-case` (in configurations
// like this one where `type` is expected to be the first thing in
// `header`.)
//
// <https://commitlint.js.org/#/reference-rules?id=header-case>
'header-case': [0, 'always', 'lower-case'],
// ### header-full-stop
//
// * condition: `header` ends with `value`
//
// <https://commitlint.js.org/#/reference-rules?id=header-full-stop>
'header-full-stop': [2, 'never', '.'],
// ### header-max-length
//
// * condition: `header` has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=header-max-length>
'header-max-length': [2, 'always', 72],
// ### header-min-length
//
// * condition: `header` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=header-min-length>
'header-min-length': [2, 'always', 0],
// ### references-empty
//
// * condition: `references` has at least one entry
//
// <https://commitlint.js.org/#/reference-rules?id=references-empty>
'references-empty': [0, 'never', null],
// ### scope-enum
//
// * condition: `scope` is found in value
//
// <https://commitlint.js.org/#/reference-rules?id=scope-enum>
'scope-enum': [2, 'always', [
'contrib',
'deps',
'github',
'lint',
'readme',
'release',
'wrapper',
'yarn',
]],
// ### scope-case
//
// * condition: `scope` is in case `value`
//
// <https://commitlint.js.org/#/reference-rules?id=scope-case>
'scope-case': [2, 'always', 'lower-case'],
// ### scope-empty
//
// * condition: `scope` is empty
//
// <https://commitlint.js.org/#/reference-rules?id=scope-empty>
'scope-empty': [2, 'never', null],
// ### scope-max-length
//
// * condition: `scope` has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=scope-max-length>
'scope-max-length': [2, 'always', Infinity],
// ### scope-min-length
//
// * condition: `scope` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=scope-min-length>
'scope-min-length': [2, 'always', 0],
// ### signed-off-by
//
// * condition: `message` has `value`
//
// <https://commitlint.js.org/#/reference-rules?id=signed-off-by>
'signed-off-by': [0, 'always', 'Signed-off-by:'],
// ### subject-case
//
// * condition: `subject` is in case `value`
//
// <https://commitlint.js.org/#/reference-rules?id=subject-case>
'subject-case': [2, 'always', 'sentence-case'],
// ### subject-empty
//
// * condition: `subject` is empty
//
// <https://commitlint.js.org/#/reference-rules?id=subject-empty>
'subject-empty': [2, 'never', null],
// ### subject-full-stop
//
// * condition: `subject` ends with `value`
//
// <https://commitlint.js.org/#/reference-rules?id=subject-full-stop>
'subject-full-stop': [2, 'never', '.'],
// ### subject-max-length
//
// * condition: `subject` has value or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=subject-max-length>
'subject-max-length': [2, 'always', 50],
// ### subject-min-length
//
// * condition: `subject` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=subject-min-length>
'subject-min-length': [2, 'always', 0],
// ### type-case
//
// * description: `type` is in case `value`
//
// <https://commitlint.js.org/#/reference-rules?id=type-case>
'type-case': [2, 'always', 'lower-case'],
// ### type-empty
//
// * condition: `type` is empty
//
// <https://commitlint.js.org/#/reference-rules?id=type-empty>
'type-empty': [2, 'never', null],
// ### type-enum
//
// * condition: `type` is found in value
//
// <https://commitlint.js.org/#/reference-rules?id=type-enum>
'type-enum': [2, 'always', [
'build',
'ci',
'chore',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
]],
// ### type-max-length
//
// * condition: `type` has `value` or less characters
//
// <https://commitlint.js.org/#/reference-rules?id=type-max-length>
'type-max-length': [2, 'always', Infinity],
// ### type-min-length
//
// * condition: `type` has `value` or more characters
//
// <https://commitlint.js.org/#/reference-rules?id=type-min-length>
'type-min-length': [2, 'always', 0],
},
}