Commit 6f97f67
committed
Add abitlity to partially override config from submodules
In the original implementation, when a submodule provided its
configuration it would completely override any config was provided by
its parent module. However with this approach the child module's
configuration will merge into its parent config and override any item
defined by both.
Example:
```
$ cat .terraform-docs.yml
formatter: markdown table
recursive:
enabled: true
sections:
show:
- header
- inputs
- outputs
output:
file: README.md
mode: inject
settings:
default: true
required: true
type: true
$ cat modules/module-b/.terraform-docs.yml
formatter: yaml
sections:
show:
- providers
settings:
default: false
escape: false
```
The computed values for module-b configuration will be:
```
formatter: yaml
recursive:
enabled: true
sections:
show:
- providers
output:
file: README.md
mode: inject
settings:
default: false
escape: false
required: true
type: true
```
Signed-off-by: Khosrow Moossavi <[email protected]>1 parent 54dc0f5 commit 6f97f67
1 file changed
+38
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 145 | + | |
141 | 146 | | |
142 | | - | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
| |||
188 | 197 | | |
189 | 198 | | |
190 | 199 | | |
191 | | - | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
229 | 237 | | |
230 | 238 | | |
231 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
232 | 256 | | |
233 | 257 | | |
234 | 258 | | |
| |||
257 | 281 | | |
258 | 282 | | |
259 | 283 | | |
260 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
261 | 289 | | |
262 | | - | |
| 290 | + | |
263 | 291 | | |
264 | 292 | | |
265 | 293 | | |
| |||
0 commit comments