Commit Graph

613 Commits

Author SHA1 Message Date
Khosrow Moossavi
90942f73b8 Move format package from internal to public
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 14:43:26 -04:00
Khosrow Moossavi
ca8f8333d4 Move template package from internal to public
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 14:18:05 -04:00
Khosrow Moossavi
b3ff51475c Move template package from internal to public
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 14:03:19 -04:00
Khosrow Moossavi
4f698fb177 Merge pull request #565 from poojitha-bikki/issue-552-dev
optionally process comments from tf files as description
2021-09-27 11:55:46 -04:00
Poojitha Bikki
045707beee feat: Add new flag 'read-comments' to optionally process comments as description
fixes issue #552

- process description from comments

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- fix module tests

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- optionally read comments for output vars description

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- set default to true

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- run make docs

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- change option name

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- add option in doc generator; make docs

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- add config 'ReadComments'

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- Fix alphabetic order for 'ReadComments' setting

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- add read-comments in docs

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- add test for readcomments option

Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>

- update 'read-comments' flag description

Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
Signed-off-by: Poojitha Bikki <50849668+poojitha-bikki@users.noreply.github.com>
2021-09-24 18:04:39 -05:00
Bryan Dady
519f25ee01 docs: fix typo in README and update configuration guide
* docs: typo in README

Adjust typo, and suggest possible readability improvement, in README.

* Fix typo in Examples

replace 2 instances of providrs with providers

Signed-off-by: Bryan Dady <bryan@subsplash.com>

* docs: 📝 Update README and user-guide/configuration.md

Incorporate suggestions from PR https://github.com/terraform-docs/terraform-docs/pull/564

Signed-off-by: Bryan Dady <bryan@subsplash.com>

* docs: 📝 Update guide/configuration.md

Incorporate suggestions from PR https://github.com/terraform-docs/terraform-docs/pull/564

Signed-off-by: Bryan Dady <bryan@dady.us>
Signed-off-by: Bryan Dady <bryan@subsplash.com>
2021-09-23 15:58:18 -04:00
Khosrow Moossavi
5cd2b8f702 Merge pull request #561 from khos2ow/update-docs
Overhaul README and docs improvements
2021-09-16 14:01:03 -04:00
Khosrow Moossavi
3d2b8788d6 Overhaul README and docs improvements
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-16 13:49:38 -04:00
Khosrow Moossavi
3d84cad448 Merge pull request #558 from khos2ow/restructure-docs
Restructure documentations
2021-09-13 18:10:12 -04:00
Khosrow Moossavi
f33826c5df Cleanup documentations
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 18:07:57 -04:00
Khosrow Moossavi
0ad14a3120 Restructure how-tos docs
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 18:07:46 -04:00
Khosrow Moossavi
1ae5fd95ca Restructure configurations docs
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 18:07:21 -04:00
Khosrow Moossavi
628f2c6ea9 Update Netlify config and build CI
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 17:30:02 -04:00
Khosrow Moossavi
39b55d16d9 Merge pull request #556 from u5surf/issues-555
Skip read lines from empty file
2021-09-10 13:18:11 -04:00
yugo-horie
5a1210b96c Skip read lines from empty file
Signed-off-by: yugo-horie <u5.horie@gmail.com>
2021-09-10 08:38:53 +09:00
Nassos Kat
f61375077e Add 'HideEmpy' section bool flag
* Add 'HideEmpy' section to Settings

Signed-off-by: akatsadimas <nkatsadim@gmail.com>

* Address review comments

fixed linting and docs, moved HideEmpty to Settings struct

Signed-off-by: akatsadimas <nkatsadim@gmail.com>

* Address review comment

document hideempty configuration option

Signed-off-by: akatsadimas <nkatsadim@gmail.com>

* Address review comments - improve docs

Signed-off-by: akatsadimas <nkatsadim@gmail.com>
2021-08-31 17:17:16 -04:00
Khosrow Moossavi
c901b89355 Bump version to v0.16.0-alpha
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-08-11 16:21:44 -04:00
Khosrow Moossavi
f3b6eab8a8 Release version v0.15.0
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
v0.15.0
2021-08-10 18:55:29 -04:00
Khosrow Moossavi
7cf36774d6 Merge pull request #548 from khos2ow/recursive
Generate submodules documents with '--resurcive' flag
2021-08-10 18:39:48 -04:00
Khosrow Moossavi
1450ee9a10 Generate submodules documents with '--resurcive' flag
Considering the file strucutre below of main module and its submodules,
now it is possible to generate documentation for them main and all its
submodules in one execution, with `--recursive` flag.

Note that generating documentation recursively is allowed only with
`--output-file` set.

Path to find submodules can be configured with `--recursive-path`
(defaults to `modules`).

Each submodule can also have their own `.terraform-docs.yml` confi file,
to override configuration from root module.

```
.
├── README.md
├── main.tf
├── modules
│   └── my-sub-module
│       ├── README.md
│       ├── main.tf
│       ├── variables.tf
│       └── versions.tf
├── outputs.tf
├── variables.tf
└── versions.tf
```

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-08-10 18:22:40 -04:00
Khosrow Moossavi
45bf4f6713 Merge pull request #545 from khos2ow/deps/docker
Bump docker images (alpine and golang)
2021-07-28 20:12:03 -04:00
Khosrow Moossavi
dfd1256ba4 Bump golang to 1.16.6-alpine
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-28 20:07:26 -04:00
Khosrow Moossavi
77bc7801b1 Bump alpine to 3.14.0
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-28 20:05:33 -04:00
Khosrow Moossavi
15fd18bc73 Merge pull request #544 from khos2ow/indented-code-block
Properly format indented code blocks
2021-07-28 19:56:14 -04:00
Khosrow Moossavi
c14edafbf0 Properly format indented code blocks
If a code block (surrounded by triple backticks) are indented, in other
words the code block is placed inside ordered or unordered list, the
closing backticks of codeblock should honor the original indentation
properly.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-28 19:48:51 -04:00
Khosrow Moossavi
5a4a4aa034 Merge pull request #543 from khos2ow/upgrade-dependencies
Upgrade go dependencies
2021-07-28 15:26:50 -04:00
Khosrow Moossavi
209ed6679e Upgrade go dependencies
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-28 15:17:32 -04:00
Khosrow Moossavi
11d71ee13b Merge pull request #542 from khos2ow/packer
Add support for generating Packer document
2021-07-28 15:14:15 -04:00
Khosrow Moossavi
d004771860 Add support for generating Packer document
Packer config, since 1.7.0, prefers HCL2 which effectively makes us to
reuse the same binary for generating documentation for it with terraform-docs
as well. The missing part was that terraform-config-inspect did not
recognize `pkr.hcl` and `pkr.json` as valid formats, which this fixes that.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-28 12:48:37 -04:00
Khosrow Moossavi
c76658c766 Merge pull request #540 from khos2ow/config-folder
Attempt looking up config file in .config folder
2021-07-27 12:11:25 -04:00
Khosrow Moossavi
f46a48b46b Attempt looking up config file in .config folder
The updated order of trying to look up for .terraform-docs.yml config
file, now, is:

1. root of module directory
2. `.config/` folder at root of module directory
3. current directory
4. `.config/` folder at current directory
5. `$HOME/.tfdocs.d/`

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-26 20:22:39 -04:00
Khosrow Moossavi
59a9f4e943 Merge pull request #539 from Damans227/master
Add new example for MacOs Install docs
2021-07-26 19:41:31 -04:00
Daman
a4f8aca1b4 Undo changes made by the editor
Signed-off-by: Damans227 <Damans227@gmail.com>
2021-07-26 19:38:52 -04:00
Damans227
af68ca2f46 Add new example for MacOs Install docs
Signed-off-by: Damans227 <Damans227@gmail.com>
2021-07-26 18:56:13 -04:00
Khosrow Moossavi
64d3cae58a Merge pull request #537 from khos2ow/output-template-line-break
Process \n as line break in --output-template flag
2021-07-23 16:55:56 -04:00
Khosrow Moossavi
490644ebd8 Increase test coverage for Config
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-23 16:50:49 -04:00
Khosrow Moossavi
ab05309463 Process \n as line break in --output-template flag
When passing `--output-template` as CLI flag, `\n` is not processed as
line break rather than literal strings, which caused a misleading error
of "value of '--output-template' should contain at least 3 lines".

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-23 12:21:09 -04:00
Khosrow Moossavi
b5a110ba6d Merge pull request #527 from khos2ow/ignore-lock-file
Ignore extracting versions from terraform.lock.hcl
2021-07-22 19:54:23 -04:00
Khosrow Moossavi
5256426650 Ignore extracting versions from terraform.lock.hcl
New flag, `--lockfile`, is added to control whether ignore reading
.terraform.lock.hcl file in an attempt to extract the exact version of
provider being used or not. Default is true.

If set to true, exact version of provider available in lock file at the
time of execution will be extracted. If set to false, the version in .tf
file will be used (either exact, or a constrained version: >=, ~>, ...)

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-22 19:48:39 -04:00
Khosrow Moossavi
4d9fc6ca93 Merge pull request #535 from khos2ow/output-check
Add output-check flag option
2021-07-22 17:34:06 -04:00
Ricardo Herrera
21eaab4fc7 add output-check option for outputs
adding option to compare outputted file with generated
terraform-doc and fail if different

Signed-off-by: Ricardo Herrera <rickhl@outlook.com>
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-07-22 17:21:11 -04:00
Khosrow Moossavi
f694e50633 Merge pull request #533 from jeanbaptistebeck/scalr-sponsorship
Add Scalr sponsorship
2021-07-14 12:06:51 -04:00
JB Beck
8a288b53d4 Add Scalr sponsorship
Signed-off-by: JB Beck <jb@scalr.com>
2021-07-14 12:42:10 +02:00
Khosrow Moossavi
d3acf53bd2 Merge pull request #526 from khos2ow/resource-no-url
Render resources without URL correctly in Markdown and Asciidoc
2021-06-17 18:21:04 -04:00
Khosrow Moossavi
bb1e21acf7 Cosmetic cleanup asciidoc module table
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-17 18:18:17 -04:00
Khosrow Moossavi
61cc005548 Render resources without URL correctly in Markdown and Asciidoc
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-17 18:17:43 -04:00
Khosrow Moossavi
8577ee60ab Merge pull request #516 from khos2ow/remove-deprecated
Remove deprecated `--sort-by-XXX`, `--show-all`, and `--hide-all` flags
2021-06-02 13:03:29 -04:00
Khosrow Moossavi
d77324cc02 Add new '--show all' and '--hide all' sections
New psuedo section `all` is added and can be used to show or hide _all_
sections. This can be used as a replacement for, now, deprecated and
removed `--show-all` and `--hide-all` flags.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-02 13:01:25 -04:00
Khosrow Moossavi
25f03b4cf4 Remove deprecated '--show-all' and '--hide-all' flags
In v0.13.0 flags `--show-all` and `--hide-all` have been deprecated. And
they are completely being removed now (two releases after original
announcement)

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-02 13:01:13 -04:00
Khosrow Moossavi
258f4603fb Remove deprecated '--sort-by-XXX' flags
In v0.13.0 flags `--sort-by-required` and `--sort-by-type` have been
deprecated in favor of `--sort-by required` and `--sort-by type`
respectively. And they are completely being removed now (two releases
after original announcement)

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-02 13:00:38 -04:00