136 Commits

Author SHA1 Message Date
Khosrow Moossavi
2353afbcae fix: Never escape special characters in tfvars json (#339)
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-10-16 18:54:47 -04:00
Khosrow Moossavi
4a98297837 fix: Cleanup extra empty lines from 'pretty' output (#338)
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-10-16 15:55:02 -04:00
Khosrow Moossavi
63750c1784 fix: Normalize last empty line of the generated output (#336)
Generated output will not have any empty line or
carriage return at the end of the last line and
one carriage return (\n) will be added when we
print that to stdout.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-10-15 18:51:30 -04:00
Tomoya Chiba
1f12a88406 Fix typo in docs/CONFIG_FILE.md (#304)
Modified `markdonw` → `markdown`
2020-08-06 21:24:46 -04:00
Julien Duchesne
52653b5107 fix: Render special chars in variables' default value properly (#284)
* Fix: No longer crashes when there are special chars in a variable default

* Do not escape chars everywhere

* Cleanup go.mod
2020-07-17 13:13:50 -04:00
Khosrow Moossavi
f71c2a360c docs: Overall improvements to documentation (#293) 2020-07-16 21:24:24 -04:00
Khosrow Moossavi
fd97ec5930 feat: Add support for .terraform-docs.yml config file (#272)
* Add support for .terraform-docs.yml config file

* add config reader

* add usage documentation and reference guide

* typo

* update docs
2020-07-13 22:06:30 -04:00
Khosrow Moossavi
6e259baf87 docs: Add detail about module header usage guide (#282) 2020-06-27 16:14:38 -04:00
Khosrow Moossavi
e0404399a7 feat: Add new flags: --show, --show-all, --hide-all (#267)
* Add new flags: --show, --show-all, --hide-all

* add deprecated flags to Config

* update docs

* add implementation for new flags

Examples:

- hide all sections except one (or more): `terraform-docs --hide-all --show <name> ...`
- show all sections except one (or more): `terraform-docs --show-all --hide <name> ...`
2020-05-25 12:08:52 -04:00
Khosrow Moossavi
04a9ef49eb refactor: Refactor cli implemention and configuration (#266)
* Refactor cli implemention and configuration

* cleanup
2020-05-20 22:21:19 -04:00
Khosrow Moossavi
23c50e0ad8 refactor: Deprecate multiple flags in favor of new ones (#265)
BREAKING CHANGE: - Following flags have been deprecated and will be
removed in the following releases:

  - Flag `--no-color` has been deprecated, use `--color=false` instead

  - Flag `--no-escape` has been deprecated, use `--escape=false` instead

  - Flag `--no-header` has been deprecated, use `--hide header` instead

  - Flag `--no-inputs` has been deprecated, use `--hide inputs` instead

  - Flag `--no-outputs` has been deprecated, use `--hide outputs` instead

  - Flag `--no-providers` has been deprecated, use `--hide providers` instead

  - Flag `--no-requirements` has been deprecated, use `--hide requirements` instead

  - Flag `--no-required` has been deprecated, use `--required=false` instead

  - Flag `--no-sensitive` has been deprecated, use `--sensitive=false` instead

  - Flag `--no-sort` has been deprecated, use `--sort=false` instead
2020-05-20 11:49:25 -04:00
Khosrow Moossavi
b397b7d46b feat: Add support for TOML renderer (#197)
* Add support for TOML renderer

* Add kind:formatter to toml command

* update docs

* adjust tests after merge

* fix after merge

* adjust tests after merge

* update docs

* remove vendor leftovers

* update doc

* update tests
2020-05-14 12:41:21 -04:00
dependabot-preview[bot]
342db66d96 build(deps): bump gopkg.in/yaml.v2 from 2.2.8 to 3.0.0 (#260)
* build(deps): bump gopkg.in/yaml.v2 from 2.2.8 to 2.3.0

Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.8 to 2.3.0.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v2.2.8...v2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* bump gopkg.in/yaml to v3

* set indentation to 2

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-05-13 18:53:01 -04:00
Khosrow Moossavi
b25909b537 feat: Add new flag to sort inputs by type (#246)
* Add new flag to sort inputs by type

* add more tests

* revert renames
2020-04-13 17:43:21 -04:00
Khosrow Moossavi
b6a6ad1bbf refactor: Remove deprecated flags (#229)
BREAKING CHANGE: - Flags `--with-aggregate-type-defaults` and
`--sort-inputs-by-required` were marked as deprecated in v0.8.2
and now are removed.
2020-04-13 12:54:48 -04:00
Rubén del Campo
37375db283 feat: Add support for AsciiDoc renderer (#241)
* Implement AsciiDoc renderer

* Add missing tests to maintain expected code coverage

* Keep alphabetical order

* Refactor indent function (accept char argument and make homogeneous for both MD and Adoc renderers)

* Force asciidoc syntax in every table column

* Remove extra NL before code blocks and add autowidth tables

* Move char argument after settings in indent function

* Implement new factory function for asciidoc renderer

* Update asciidoc table docs

* Return empty indentation if no indent scpecified

* Prevent adding a trailing whitespace in table rows

* Change asciidoc alias to match file extension

* Update docs
2020-04-12 15:22:53 -04:00
Khosrow Moossavi
c196c7cc49 refactor: Add factory function to return format types (#243) 2020-04-10 19:08:37 -04:00
Khosrow Moossavi
a3e0a56ce6 fix: Mark variables not required if default set to null (#221)
* Mark variables not required if default set to null

* Move github.com/hashicorp/terraform-config-inspect to internal/tfconfig

Internally we depend on terraform-config-inspect, but at the moment
they state that they consider the project is feature-complete and
they do not accept any enhancement pull requests, as such we've
decided to bring over the project as internal package here rather than
being a vendor dependency and apply the fix from @jstewmon from
https://github.com/hashicorp/terraform-config-inspect/pull/24 directly
here.

Since the terraform-config-inspect is considered to be feature-complete
we don't expect to have any more changes on the package, and if there
was a change on upstream we're going to bring it down in the
corresponding package.

* Add notice to the new package

* add license of terraform-config-inspect code

* fix tests after merging master

* fix test after merge master

* show 'required' attribute in JSON, XML, YAML

* update docs
2020-03-30 16:16:55 -04:00
Khosrow Moossavi
40bd96be44 docs: Enhance automatic document generation (#227)
* Enhance automatic document generation

* update contribuor guide

* fix broken link
2020-03-29 18:17:55 -04:00
Khosrow Moossavi
9043f268ad feat: Add support for tfvars hcl and json commands (#226)
* Add support for tfvars hcl and json commands

* fix docs generation header issue

* align padding of hcl tfvars items

* add more tests

* update docs

* wording
2020-03-27 15:02:09 -04:00
Julien Duchesne
2caf4af15d feat: Allow hiding the "Sensitive" column in markdown (#223)
* Allow hiding the "Sensitive" column in markdown

Use case: for projects where all outputs are expected to not be sensitive, it adds noise

* Document the new --no-sensitive option

* Fixed tests, they were written on a previous branch

* Fix tests following merge with master

* Update internal/format/document.go

Co-Authored-By: Khosrow Moossavi <khos2ow@gmail.com>

Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-03-25 11:56:23 -04:00
Khosrow Moossavi
b6241751d9 feat: Add section for module requirements (#222)
* Add section for module requirements

* cleanup

* reorder items logically
2020-03-24 14:20:13 -04:00
Khosrow Moossavi
01c8fa1c61 feat: Add support for fetching the module header from any file (#217)
* Add support for fetching the module header from any file

* fix the failing test because of lines reader
2020-03-12 13:58:35 -04:00
Aaron Steers
7c91a310ce docs: Put reference to usage, cli, etc. in user guide (#216)
resolves #180
2020-03-11 11:08:00 -04:00
JamesUoM
50254f0bec docs: Example git hook to keep module docs up to date (#214)
* git hook to keep module docs upto date

* Move git hook to user documentation

Co-authored-by: James S Perrin <james.s.perrin@manchester.ac.uk>
2020-03-09 10:31:48 -04:00
Khosrow Moossavi
b716a25811 feat: Add support for XML renderer (#198)
* Add support for XML renderer

* formatting

* update docs
2020-02-26 14:44:50 -05:00
Khosrow Moossavi
9d82e17884 Update format docs 2020-02-19 18:28:02 -05:00
Khosrow Moossavi
743d4f3ebc refactor: Add Default value types for better marshalling (#196)
* Add Default value types for better marshalling

* fix output-values tests
2020-02-19 15:37:48 -05:00
Khosrow Moossavi
54ab7f9bbb docs: Auto generate formats document from examples (#192)
* Auto generate formats document from examples

* fix lint issues
2020-02-10 20:53:57 -05:00
Khosrow Moossavi
42ad476a37 feat: Add support for YAML renderer (#189) 2020-02-03 20:13:10 -05:00
Khosrow Moossavi
bf07706947 fix: Do not escape markdown table inside module header (#186) 2020-02-01 14:21:54 -05:00
Khosrow Moossavi
43f69d337f fix: Preserve asterisk list in header and fix escaping (#179) 2020-01-30 18:47:32 -05:00
Khosrow Moossavi
bf38a75fe3 fix: Add newline between code block and trailing lines (#184) 2020-01-30 18:09:45 -05:00
Khosrow Moossavi
b604bce0c7 fix: Show native map and list as default value in JSON (#174) 2020-01-20 16:04:12 -05:00
Khosrow Moossavi
6ff46a26b1 fix: Do not escape any characters of a URL (#170) 2020-01-17 13:45:48 -05:00
Khosrow Moossavi
0227bb9d8d docs: Initial commit of usage documentation (#162)
* Initial commit of usage documentation

* update json document
2020-01-17 12:49:15 -05:00