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
Copy file name to clipboardExpand all lines: .pre-commit-hooks.yaml
+9
Original file line number
Diff line number
Diff line change
@@ -15,3 +15,12 @@
15
15
language: golang
16
16
name: Helm Docs Built
17
17
require_serial: true
18
+
19
+
- id: helm-docs-container
20
+
args: []
21
+
description: Uses the container image of 'helm-docs' to create documentation from the Helm chart's 'values.yaml' file, and inserts the result into a corresponding 'README.md' file.
Copy file name to clipboardExpand all lines: README.md
+80-13
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,73 @@ pre-commit install-hooks
99
99
100
100
Future changes to your chart's `requirements.yaml`, `values.yaml`, `Chart.yaml`, or `README.md.gotmpl` files will cause an update to documentation when you commit.
101
101
102
+
There are several variants of `pre-commit` hooks to choose from depending on your use case.
103
+
104
+
#### `helm-docs` Uses `helm-docs` binary located in your `PATH`
105
+
106
+
```yaml
107
+
---
108
+
repos:
109
+
- repo: https://github.com/jnorwood/helm-docs
110
+
rev: ""
111
+
hooks:
112
+
- id: helm-docs
113
+
args:
114
+
# Make the tool search for charts only under the `charts` directory
115
+
- --chart-search-root=charts
116
+
117
+
```
118
+
119
+
120
+
#### `helm-docs-built` Uses `helm-docs` built from code in git
121
+
122
+
```yaml
123
+
---
124
+
repos:
125
+
- repo: https://github.com/jnorwood/helm-docs
126
+
rev: ""
127
+
hooks:
128
+
- id: helm-docs-built
129
+
args:
130
+
# Make the tool search for charts only under the `charts` directory
131
+
- --chart-search-root=charts
132
+
133
+
```
134
+
135
+
136
+
#### `helm-docs-container` Uses the container image of `helm-docs:latest`
137
+
138
+
```yaml
139
+
---
140
+
repos:
141
+
- repo: https://github.com/jnorwood/helm-docs
142
+
rev: ""
143
+
hooks:
144
+
- id: helm-docs-container
145
+
args:
146
+
# Make the tool search for charts only under the `charts` directory
147
+
- --chart-search-root=charts
148
+
149
+
```
150
+
151
+
#### To pin the `helm-docs` container to a specific tag, follow the example below:
152
+
153
+
154
+
```yaml
155
+
---
156
+
repos:
157
+
- repo: https://github.com/jnorwood/helm-docs
158
+
rev: ""
159
+
hooks:
160
+
- id: helm-docs-container
161
+
entry: jnorwood/helm-docs:x.y.z
162
+
args:
163
+
# Make the tool search for charts only under the `charts` directory
164
+
- --chart-search-root=charts
165
+
166
+
```
167
+
168
+
102
169
### Running the binary directly
103
170
104
171
To run and generate documentation into READMEs for all helm charts within or recursively contained by a directory:
@@ -441,16 +508,16 @@ By default, this option is turned off:
441
508
442
509
```shell
443
510
./helm-docs -c example-charts/helm-3
444
-
INFO[2023-06-29T07:54:29-07:00] Found Chart directories [.]
445
-
INFO[2023-06-29T07:54:29-07:00] Generating README Documentation for chart example-charts/helm-3
511
+
INFO[2023-06-29T07:54:29-07:00] Found Chart directories [.]
512
+
INFO[2023-06-29T07:54:29-07:00] Generating README Documentation for chart example-charts/helm-3
446
513
```
447
514
448
515
but you can use the `-x` flag to turn it on:
449
516
450
517
```shell
451
518
helm-docs -x -c example-charts/helm-3
452
-
INFO[2023-06-29T07:55:12-07:00] Found Chart directories [.]
453
-
WARN[2023-06-29T07:55:12-07:00] Error parsing information for chart ., skipping: values without documentation:
519
+
INFO[2023-06-29T07:55:12-07:00] Found Chart directories [.]
520
+
WARN[2023-06-29T07:55:12-07:00] Error parsing information for chart ., skipping: values without documentation:
454
521
controller
455
522
controller.name
456
523
controller.image
@@ -469,29 +536,29 @@ The CLI also supports excluding fields by regexp using the `-z` argument
0 commit comments