Skip to content

Commit 204d436

Browse files
docs: update README
* add debug command * update default config
1 parent e13a902 commit 204d436

File tree

1 file changed

+53
-51
lines changed

1 file changed

+53
-51
lines changed

README.md

+53-51
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ commitlint checks if your commit message meets the [conventional commit format](
2424
- [Setup](#setup)
2525
- [Manual](#manual)
2626
- [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)
27+
- [Commands](#commands)
28+
- [config](#config)
29+
- [lint](#lint)
30+
- [Precedence](#precedence)
31+
- [Config](#config-1)
32+
- [Message](#message)
33+
- [hook](#hook)
34+
- [debug](#debug)
3535
- [Default Config](#default-config)
3636
- [Commit Types](#commit-types)
3737
- [Available Rules](#available-rules)
@@ -90,28 +90,26 @@ echo "fear: do not fear for commit message" | commitlint lint
9090
# ❌ type-enum: type 'fear' is not allowed, you can use one of [build chore ci docs feat fix merge perf refactor revert style test]
9191
```
9292

93-
## Usage
93+
## Commands
9494

95-
### Commands
96-
97-
#### config
95+
### config
9896

9997
- To create config file, run `commitlint config create` this will create `commitlint.yaml`
10098

10199
- To validate config file, run `commitlint config check --config=/path/to/conf.yaml`
102100

103-
#### lint
101+
### lint
104102

105103
To lint a message, you can use any one of the following
106104
- run `commitlint lint --message=file`
107105
- run `echo "message" | commitlint lint`
108106
- run `commitlint lint < file`
109107

110-
##### Precedence
108+
#### Precedence
111109

112110
`commitlint lint` follows below order for `config` and `message`
113111

114-
###### Config
112+
##### Config
115113

116114
- config file passed to `--config` command-line argument
117115
- `COMMITLINT_CONFIG` env variable
@@ -122,53 +120,57 @@ To lint a message, you can use any one of the following
122120
- commitlint.yaml
123121
- [default config](#default-config)
124122

125-
###### Message
123+
##### Message
126124

127125
- `stdin` pipe stream
128126
- commit message file passed to `--message` command-line argument
129127
- `.git/COMMIT_EDITMSG` in current directory
130128

131-
#### hook
129+
### hook
132130

133131
- To create hook files, run `commitlint hook create`
134132

133+
### debug
134+
135+
To prints useful information for debugging commitlint
136+
137+
run `commitlint debug`
138+
135139
### Default Config
136140

137141
```yaml
138-
version: v0.7.0
142+
version: v0.8.0
139143
formatter: default
140144
rules:
141-
header-min-length:
142-
enabled: true
143-
severity: error
144-
argument: 10
145-
header-max-length:
146-
enabled: true
147-
severity: error
148-
argument: 50
149-
body-max-line-length:
150-
enabled: true
151-
severity: error
152-
argument: 72
153-
footer-max-line-length:
154-
enabled: true
155-
severity: error
156-
argument: 72
157-
type-enum:
158-
enabled: true
159-
severity: error
160-
argument:
161-
- feat
162-
- fix
163-
- docs
164-
- style
165-
- refactor
166-
- perf
167-
- test
168-
- build
169-
- ci
170-
- chore
171-
- revert
145+
- header-min-length
146+
- header-max-length
147+
- body-max-line-length
148+
- footer-max-line-length
149+
- type-enum
150+
severity:
151+
default: error
152+
settings:
153+
body-max-line-length:
154+
argument: 72
155+
footer-max-line-length:
156+
argument: 72
157+
header-min-length:
158+
argument: 10
159+
header-max-length:
160+
argument: 50
161+
type-enum:
162+
argument:
163+
- feat
164+
- fix
165+
- docs
166+
- style
167+
- refactor
168+
- perf
169+
- test
170+
- build
171+
- ci
172+
- chore
173+
- revert
172174
```
173175
174176
#### Commit Types
@@ -225,15 +227,15 @@ commitlint
225227
→ input: "fear: do not fear for ..."
226228

227229
Errors:
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]
230+
❌ type-enum: type 'fear' is not allowed, you can use one of [build chore ci docs feat fix perf refactor revert style test]
229231

230232
Total 1 errors, 0 warnings, 0 other severities
231233
```
232234

233235
- JSON
234236

235237
```json
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":[]}
238+
{"input":"fear: do not fear for commit message","issues":[{"description":"type 'fear' is not allowed, you can use one of [build chore ci docs feat fix perf refactor revert style test]","name":"type-enum","severity":"error"}]}
237239
```
238240

239241
## Extensibility

0 commit comments

Comments
 (0)