Skip to content

Commit b681031

Browse files
docs: update README
1 parent 01a6c61 commit b681031

File tree

1 file changed

+56
-47
lines changed

1 file changed

+56
-47
lines changed

README.md

+56-47
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,29 @@ commitlint checks if your commit message meets the [conventional commit format](
1616

1717
### Table of Contents
1818

19-
- [Installation](#installation)
20-
- [Releases](#releases)
21-
- [Using go](#using-go)
22-
- [Setup](#setup)
23-
- [Manual](#manual)
24-
- [Quick Test](#quick-test)
25-
- [Usage](#usage)
26-
- [Commands](#commands)
27-
- [config](#config)
28-
- [lint](#lint)
29-
- [Default Config](#default-config)
30-
- [Commit Types](#commit-types)
31-
- [Available Rules](#available-rules)
32-
- [Available Formatters](#available-formatters)
33-
- [Extensibility](#extensibility)
34-
- [FAQ](#faq)
35-
- [License](#license)
19+
- [commitlint](#commitlint)
20+
- [Table of Contents](#table-of-contents)
21+
- [Installation](#installation)
22+
- [Releases](#releases)
23+
- [Using go](#using-go)
24+
- [Setup](#setup)
25+
- [Manual](#manual)
26+
- [Quick Test](#quick-test)
27+
- [Usage](#usage)
28+
- [Commands](#commands)
29+
- [config](#config)
30+
- [lint](#lint)
31+
- [Precedence](#precedence)
32+
- [Config](#config-1)
33+
- [Message](#message)
34+
- [hook](#hook)
35+
- [Default Config](#default-config)
36+
- [Commit Types](#commit-types)
37+
- [Available Rules](#available-rules)
38+
- [Available Formatters](#available-formatters)
39+
- [Extensibility](#extensibility)
40+
- [FAQ](#faq)
41+
- [License](#license)
3642

3743
## Installation
3844

@@ -107,8 +113,13 @@ To lint a message, you can use any one of the following
107113

108114
###### Config
109115

110-
- `commitlint.yaml` config file in current directory
111116
- config file passed to `--config` command-line argument
117+
- `COMMITLINT_CONFIG` env variable
118+
- config file in current directory or git repo root in the below order
119+
- .commitlint.yml
120+
- .commitlint.yaml
121+
- commitlint.yml
122+
- commitlint.yaml
112123
- [default config](#default-config)
113124

114125
###### Message
@@ -124,6 +135,7 @@ To lint a message, you can use any one of the following
124135
### Default Config
125136

126137
```yaml
138+
version: v0.7.0
127139
formatter: default
128140
rules:
129141
header-min-length:
@@ -157,15 +169,14 @@ rules:
157169
- ci
158170
- chore
159171
- revert
160-
- merge
161172
```
162173
163174
#### Commit Types
164175
165176
Commonly used commit types from [Conventional Commit Types](https://github.com/commitizen/conventional-commit-types)
166177
167178
| Type | Description |
168-
|:---------|:---------------------------------------------------------------------------------|
179+
| :------- | :------------------------------------------------------------------------------- |
169180
| feat | A new feature |
170181
| fix | A bug fix |
171182
| docs | Documentation only changes |
@@ -177,33 +188,32 @@ Commonly used commit types from [Conventional Commit Types](https://github.com/c
177188
| ci | Changes to our CI configuration files and scripts |
178189
| chore | Other changes that don't modify src or test files |
179190
| revert | Reverts a previous commit |
180-
| merge | Merges a branch |
181191
182192
## Available Rules
183193
184194
The list of available lint rules
185195
186-
| name | argument | flags | description |
187-
| ---------------------- | -------- | ----------------- | -------------------------------------------- |
188-
| header-min-length | int | n/a | checks the min length of header (first line) |
189-
| header-max-length | int | n/a | checks the max length of header (first line) |
190-
| body-max-line-length | int | n/a | checks the max length of each line in body |
191-
| footer-max-line-length | int | n/a | checks the max length of each line in footer |
192-
| type-enum | []string | n/a | restrict type to given list of string |
193-
| scope-enum | []string | allow-empty: bool | restrict scope to given list of string |
194-
| type-min-length | int | n/a | checks the min length of type |
195-
| type-max-length | int | n/a | checks the max length of type |
196-
| scope-min-length | int | n/a | checks the min length of scope |
197-
| scope-max-length | int | n/a | checks the max length of scope |
198-
| description-min-length | int | n/a | checks the min length of description |
199-
| description-max-length | int | n/a | checks the max length of description |
200-
| body-min-length | int | n/a | checks the min length of body |
201-
| body-max-length | int | n/a | checks the max length of body |
202-
| footer-min-length | int | n/a | checks the min length of footer |
203-
| footer-max-length | int | n/a | checks the max length of footer |
204-
| type-charset | string | n/a | restricts type to given charset |
205-
| scope-charset | string | n/a | restricts scope to given charset |
206-
196+
| name | argument | flags | description |
197+
| ---------------------- | -------- | ----------------- | --------------------------------------------- |
198+
| header-min-length | int | n/a | checks the min length of header (first line) |
199+
| header-max-length | int | n/a | checks the max length of header (first line) |
200+
| body-max-line-length | int | n/a | checks the max length of each line in body |
201+
| footer-max-line-length | int | n/a | checks the max length of each line in footer |
202+
| type-enum | []string | n/a | restrict type to given list of string |
203+
| scope-enum | []string | allow-empty: bool | restrict scope to given list of string |
204+
| footer-enum | []string | n/a | restrict footer token to given list of string |
205+
| type-min-length | int | n/a | checks the min length of type |
206+
| type-max-length | int | n/a | checks the max length of type |
207+
| scope-min-length | int | n/a | checks the min length of scope |
208+
| scope-max-length | int | n/a | checks the max length of scope |
209+
| description-min-length | int | n/a | checks the min length of description |
210+
| description-max-length | int | n/a | checks the max length of description |
211+
| body-min-length | int | n/a | checks the min length of body |
212+
| body-max-length | int | n/a | checks the max length of body |
213+
| footer-min-length | int | n/a | checks the min length of footer |
214+
| footer-max-length | int | n/a | checks the max length of footer |
215+
| type-charset | string | n/a | restricts type to given charset |
216+
| scope-charset | string | n/a | restricts scope to given charset |
207217
208218
## Available Formatters
209219
@@ -215,15 +225,15 @@ commitlint
215225
→ input: "fear: do not fear for ..."
216226

217227
Errors:
218-
❌ type-enum: type 'fear' is not allowed, you can use one of [build chore ci docs feat fix merge perf refactor revert style test]
228+
❌ type-enum: type 'fear' is not allowed, you can use one of [build chore ci docs feat fix merge perf refactor revert style test]
219229

220-
Total 1 errors, 0 warnings
230+
Total 1 errors, 0 warnings, 0 other severities
221231
```
222232

223233
- JSON
224234

225235
```json
226-
{"errors":[{"message":"type 'fear' is not allowed, you can use one of [build chore ci docs feat fix merge perf refactor revert style test]","name":"type-enum"}],"input":"fear: do not fear for commit","status":false,"warnings":[]}
236+
{"errors":[{"messages":["type 'fear' is not allowed, you can use one of [build chore ci docs feat fix merge perf refactor revert style test]"],"name":"type-enum"}],"input":"fear: do not fear for commit message","others":[],"status":false,"warnings":[]}
227237
```
228238

229239
## Extensibility
@@ -232,7 +242,7 @@ Total 1 errors, 0 warnings
232242

233243
- How to have custom config for each repository?
234244

235-
Place `commitlint.yaml` file in repo root directory. linter follows [config precedence](#precedence).
245+
Place `.commitlint.yaml` file in repo root directory. linter follows [config precedence](#precedence).
236246

237247
To create a sample config, run `commitlint config create`
238248

@@ -243,4 +253,3 @@ Total 1 errors, 0 warnings
243253
## License
244254

245255
All packages are licensed under [MIT License](LICENSE.md)
246-

0 commit comments

Comments
 (0)