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
- run `commitlint hook create` to create `.commitlint/hooks` containing git hooks
79
-
- pass `--hookspath` to customize the hooks output path
83
+
- run `commitlint hook` to create `.commitlint/hooks` containing git hooks
84
+
- pass `--hookspath`or `-p`to customize the hooks output path
80
85
- To enable in single repo
81
86
- run `git config core.hooksPath /path/to/.commitlint/hooks`
82
87
- To enable globally
83
88
- run `git config --global core.hooksPath /path/to/.commitlint/hooks`
84
89
90
+
### Remove
91
+
92
+
- To remove hooks from a single repository
93
+
94
+
```bash
95
+
commitlint remove
96
+
```
97
+
98
+
- To remove hooks globally
99
+
100
+
```bash
101
+
commitlint remove --global
102
+
```
103
+
104
+
Both commands ask for confirmation before unsetting `core.hooksPath` in git config. Hook files are left intact.
105
+
85
106
## Quick Test
86
107
87
108
- Valid commit message
@@ -102,9 +123,11 @@ echo "fear: do not fear for commit message" | commitlint lint
102
123
103
124
### config
104
125
105
-
- To create config file, run `commitlint config create` this will create `commitlint.yaml`
126
+
- To create a config file, run `commitlint config create`, this will create `.commitlint.yaml` with only the enabled rules and their settings (compact format)
127
+
128
+
- To create a config file with **all** rules and settings written out (including disabled ones), run `commitlint config create --all`
106
129
107
-
- To validate config file, run `commitlint config check --config=/path/to/conf.yaml`
130
+
- To validate a config file, run `commitlint config check /path/to/conf.yaml`
108
131
109
132
### lint
110
133
@@ -136,7 +159,9 @@ To lint a message, you can use any one of the following
136
159
137
160
### hook
138
161
139
-
- To create hook files, run `commitlint hook create`
162
+
- To create hook files, run `commitlint hook`
163
+
- pass `--hookspath` or `-p` to customize the hooks output directory
164
+
- pass `--replace` or `-r` to overwrite existing hook files
140
165
141
166
### debug
142
167
@@ -147,7 +172,7 @@ To lint a message, you can use any one of the following
147
172
## Default Config
148
173
149
174
```yaml
150
-
min-version: v0.9.0
175
+
min-version: v0.11.0
151
176
formatter: default
152
177
rules:
153
178
- header-min-length
@@ -157,15 +182,20 @@ rules:
157
182
- type-enum
158
183
severity:
159
184
default: error
185
+
rules: {}
160
186
settings:
161
187
body-max-line-length:
162
-
argument: 72
188
+
argument: 100
189
+
flags: {}
163
190
footer-max-line-length:
191
+
argument: 100
192
+
flags: {}
193
+
header-max-length:
164
194
argument: 72
195
+
flags: {}
165
196
header-min-length:
166
197
argument: 10
167
-
header-max-length:
168
-
argument: 50
198
+
flags: {}
169
199
type-enum:
170
200
argument:
171
201
- feat
@@ -179,6 +209,9 @@ settings:
179
209
- ci
180
210
- chore
181
211
- revert
212
+
flags: {}
213
+
disable-default-ignores: false
214
+
ignores: []
182
215
```
183
216
184
217
### Commit Types
@@ -199,6 +232,53 @@ Commonly used commit types from [Conventional Commit Types](https://github.com/c
199
232
| chore | Other changes that don't modify src or test files |
200
233
| revert | Reverts a previous commit |
201
234
235
+
## Ignore Patterns
236
+
237
+
commitlint automatically skips linting for commit messages generated by git (merges, reverts, fixups, etc.).
238
+
If the **first line** of a commit message matches any ignore pattern, linting is skipped entirely.
0 commit comments