@@ -29,7 +29,7 @@ resolves `extends` configurations.
29
29
30
30
``` shell
31
31
❯ conventional-changelog-lint --help
32
- conventional-changelog-lint@0.1.0 - Lint commit messages against a conventional-changelog preset and ruleset
32
+ conventional-changelog-lint - Lint commit messages against a conventional-changelog preset and ruleset
33
33
34
34
[input] reads from stdin if --edit, --from, --to are omitted
35
35
--color,-c toggle formatted output, defaults to: true
@@ -42,6 +42,41 @@ resolves `extends` configurations.
42
42
43
43
` ` `
44
44
45
+ # ## Recipes
46
+
47
+ # ### git hook
48
+ As a ` commitmsg` git-hook with [" husky" ](https://git.io/JDwyQg)
49
+
50
+ ` ` ` json
51
+ {
52
+ " scripts" : {
53
+ " commitmsg" : " conventional-changelog-lint -e"
54
+ }
55
+ }
56
+ ` ` `
57
+
58
+
59
+ # ### Last commit
60
+ As part of ` npm test`
61
+
62
+ ` ` ` json
63
+ {
64
+ " scripts" : {
65
+ " test" : " conventional-changelog-lint --from=HEAD~1"
66
+ }
67
+ }
68
+ ` ` `
69
+
70
+ # ### Travis
71
+
72
+ ` ` ` yml
73
+ # Force full git checkout
74
+ before_install: git fetch --unshallow
75
+
76
+ # Lint all commits not in the target branch
77
+ before_script: conventional-changelog-lint --from=$TRAVIS_BRANCH to=$TRAVIS_PULL_REQUEST_BRANCH
78
+ ` ` `
79
+
45
80
# ## API
46
81
47
82
The programming interface does not read configuration by default,
@@ -77,28 +112,6 @@ const report = lint(
77
112
);
78
113
` ` `
79
114
80
- # ## Recipes
81
-
82
- * As a ` commitmsg` git-hook with [" husky" ](https://git.io/JDwyQg)
83
-
84
- ` ` ` json
85
- {
86
- " scripts" : {
87
- " commitmsg" : " conventional-changelog-lint -e"
88
- }
89
- }
90
- ` ` `
91
-
92
- * As part of ` npm test`
93
-
94
- ` ` ` json
95
- {
96
- " scripts" : {
97
- " test" : " conventional-changelog-lint --from=HEAD~1"
98
- }
99
- }
100
- ` ` `
101
-
102
115
# # Configuration
103
116
104
117
` conventional-changelog-lint` is configured via
@@ -186,6 +199,45 @@ wildcards: {
186
199
}
187
200
` ` `
188
201
202
+ # # Shallow clones
203
+
204
+ # ## TL;DR
205
+
206
+ Perform ` git fetch --shallow` before linting.
207
+
208
+ Most likely you are reading this because you where presented with an error message:
209
+
210
+ ` ` `
211
+ ' Could not get git history from shallow clone.
212
+ Use git fetch --shallow before linting.
213
+ Original issue: https://git.io/vyKMq\n Refer to https://git.io/vyKMv for details.'
214
+ ` ` `
215
+
216
+ # ## Explanation
217
+
218
+ git supports checking out ` shallow` clones of a repository to save bandwith in times.
219
+ These limited copies do not contain a full git history. This makes ` conventional-changelog-lint`
220
+ fail, especially when running on large commit ranges.
221
+ To ensure linting works every time you should convert a shallow git repo to a complete one.
222
+ Use ` git fetch --shallow` to do so.
223
+
224
+ # ## Travis
225
+
226
+ Ensure full git checkouts on TravisCI, add to ` .travis.yml` :
227
+
228
+ ` ` ` yml
229
+ before_install:
230
+ - git fetch --unshallow
231
+ ` ` `
232
+
233
+ # ## Appveyor
234
+
235
+ Ensure full git checkouts on AppVeyor, add to ` appveyor.yml` :
236
+
237
+ ` ` ` yml
238
+ shallow_clone: false
239
+ ` ` `
240
+
189
241
# # Supported Node.js versions
190
242
191
243
conventional-changelog-lint supports the active Node.js [LTS](https://github.com/nodejs/LTS#lts-schedule) version and higher: ` > = 4`
0 commit comments