Skip to content

Commit bb10971

Browse files
committed
Deprecate Settings and Options in favor of Config
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
1 parent d2fe2b1 commit bb10971

File tree

96 files changed

+1288
-2080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1288
-2080
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ issues:
122122
- gosec
123123
- scopelint
124124
- unparam
125+
- goconst
125126

126127
# - text: "should have a package comment"
127128
# linters:

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,7 @@ func buildTerraformDocs(path string, tmpl string) (string, error) {
294294
config := print.DefaultConfig()
295295
config.ModuleRoot = path // module root path (can be relative or absolute)
296296

297-
_, options := config.Extract()
298-
299-
module, err := terraform.LoadWithOptions(options)
297+
module, err := terraform.LoadWithOptions(config)
300298
if err != nil {
301299
return "", err
302300
}

docs/reference/asciidoc-document.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,4 +484,8 @@ generates the following output:
484484

485485
Description: It's unquoted output.
486486

487+
## This is an example of a footer
488+
489+
It looks exactly like a header, but is placed at the end of the document
490+
487491
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples

docs/reference/asciidoc-table.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,8 @@ generates the following output:
421421
|[[output_unquoted]] <<output_unquoted,unquoted>> |It's unquoted output.
422422
|===
423423

424+
## This is an example of a footer
425+
426+
It looks exactly like a header, but is placed at the end of the document
427+
424428
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples

docs/reference/json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ generates the following output:
5757

5858
{
5959
"header": "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.\n\n| Name | Description |\n|------|-----------------|\n| Foo | Foo description |\n| Bar | Bar description |",
60-
"footer": "",
60+
"footer": "## This is an example of a footer\n\nIt looks exactly like a header, but is placed at the end of the document",
6161
"inputs": [
6262
{
6363
"name": "bool-1",

docs/reference/markdown-document.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,4 +486,8 @@ generates the following output:
486486

487487
Description: It's unquoted output.
488488

489+
## This is an example of a footer
490+
491+
It looks exactly like a header, but is placed at the end of the document
492+
489493
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples

docs/reference/markdown-table.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,8 @@ generates the following output:
184184
| <a name="output_output-2"></a> [output-2](#output\_output-2) | It's output number two. |
185185
| <a name="output_unquoted"></a> [unquoted](#output\_unquoted) | It's unquoted output. |
186186

187+
## This is an example of a footer
188+
189+
It looks exactly like a header, but is placed at the end of the document
190+
187191
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples

docs/reference/pretty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,8 @@ generates the following output:
259259
output.unquoted
260260
It's unquoted output.
261261

262+
## This is an example of a footer
263+
264+
It looks exactly like a header, but is placed at the end of the document
265+
262266
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples

docs/reference/toml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ terraform-docs toml --footer-from footer.md ./examples/
5555
generates the following output:
5656

5757
header = "Usage:\n\nExample of 'foo_bar' module in `foo_bar.tf`.\n\n- list item 1\n- list item 2\n\nEven inline **formatting** in _here_ is possible.\nand some [link](https://domain.com/)\n\n* list item 3\n* list item 4\n\n```hcl\nmodule \"foo_bar\" {\n source = \"github.com/foo/bar\"\n\n id = \"1234567890\"\n name = \"baz\"\n\n zones = [\"us-east-1\", \"us-west-1\"]\n\n tags = {\n Name = \"baz\"\n Created-By = \"first.last@email.com\"\n Date-Created = \"20180101\"\n }\n}\n```\n\nHere is some trailing text after code block,\nfollowed by another line of text.\n\n| Name | Description |\n|------|-----------------|\n| Foo | Foo description |\n| Bar | Bar description |"
58-
footer = ""
58+
footer = "## This is an example of a footer\n\nIt looks exactly like a header, but is placed at the end of the document"
5959

6060
[[inputs]]
6161
name = "bool-1"

docs/reference/xml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ generates the following output:
5656

5757
<module>
5858
<header>Usage:&#xA;&#xA;Example of &#39;foo_bar&#39; module in `foo_bar.tf`.&#xA;&#xA;- list item 1&#xA;- list item 2&#xA;&#xA;Even inline **formatting** in _here_ is possible.&#xA;and some [link](https://domain.com/)&#xA;&#xA;* list item 3&#xA;* list item 4&#xA;&#xA;```hcl&#xA;module &#34;foo_bar&#34; {&#xA; source = &#34;github.com/foo/bar&#34;&#xA;&#xA; id = &#34;1234567890&#34;&#xA; name = &#34;baz&#34;&#xA;&#xA; zones = [&#34;us-east-1&#34;, &#34;us-west-1&#34;]&#xA;&#xA; tags = {&#xA; Name = &#34;baz&#34;&#xA; Created-By = &#34;first.last@email.com&#34;&#xA; Date-Created = &#34;20180101&#34;&#xA; }&#xA;}&#xA;```&#xA;&#xA;Here is some trailing text after code block,&#xA;followed by another line of text.&#xA;&#xA;| Name | Description |&#xA;|------|-----------------|&#xA;| Foo | Foo description |&#xA;| Bar | Bar description |</header>
59-
<footer></footer>
59+
<footer>## This is an example of a footer&#xA;&#xA;It looks exactly like a header, but is placed at the end of the document</footer>
6060
<inputs>
6161
<input>
6262
<name>bool-1</name>

0 commit comments

Comments
 (0)