8 Commits

Author SHA1 Message Date
Khosrow Moossavi
e72f215e3e Always convert CRLF to LF for output description
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2022-01-07 19:09:55 -05:00
Simon Clifford
aa1e6bbf59 Add support for footer docs
Enables a footer to be appended to the end of a generated document
sourced from tf files or documents in the same way as the header

Adds the `footer-from` field to the config yml
Adds the `--footer-from` flag to the cli

Signed-off-by: Simon Clifford <siclifford@gmail.com>
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-15 14:51:00 -04:00
Khosrow Moossavi
7e489d2bbb Do not modify header lines and trailing whitespaces
This is going to preserve line-ending of extracted header text as they
are provided by users. In other words we are going to always assume the
header text is formatted in the "intended" way by users. So we're never
going to modify line-endings and won't append `<SPACE><SPACE>` at the
end of paragraph lines.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-13 13:43:03 -05:00
Khosrow Moossavi
92d7a60d5e Use embedded template files
Embedding files was added in go1.16, so instead of defining required
templates as constant in .go files, they are moved to dedicated .tmpl
files.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-01 16:49:38 -05:00
Khosrow Moossavi
9729ec8f92 fix: Normalize variables with CRLF line ending in heredoc (#307) 2020-08-13 09:02:08 -04:00
Khosrow Moossavi
79e926ee43 enhance: Add extensive tests coverage for all the packages (#208)
* Add more test coverage

* add format/util test

* add tfconf/input test

* add line reader test

* cleanup

* add tfconf/output test

* improve internal/module/input coverage

* improve internal/module/options coverage

* improve internal/reader coverage

* improve internal/types coverage

* appease lint

* improve pkg/tfconf/output coverage

* add coverage to test target in makefile

* improve pkg/tmpl/sanitizer coverage

* use 'test' target on action

* always prepare codecov report, even if tests are failing

* fix double-space new line issue

* extensive tests for escaping characters

* enhance nad fix escape characters failing tests

* improve internal/module/module coverage

* improve pkg/tmpl/template coverage

* cleanup
2020-03-09 20:56:29 -04:00
Thomas Alton
b8da8c5020 feat: Support Terraform 0.12.x configuration (#113)
* Support 0.12 configuration

* Move code out of GOPATH for CircleCI

* cleanup

* Rename 'variables' back to 'input' just for now

* Normalizing 'print.s.Settings' usage

* Normalize settings continued

* Remove '--providers' functionality for now

* Adjust 'commands' based on moarta's changes

* Adjust 'pkg/doc' based on moarta's changes

* Adjust 'pkg/print/json' based on moarta's changes

* Fix json tests

* don't trim whitespaces from .tf files

* Adjust 'pkg/print/pretty' based on moarta's changes

* Fix pretty tests

* don't trim whitespaces from .golden files

* Show 'n/a' for empty description for 'pretty'

* Show 'any' if type of input variable is missing

* Adjust 'pkg/print/markdown/document' based on moarta's changes

* Fix document tests

* move back vendor files

* Adjust 'pkg/print/markdown/table' based on moarta's changes

* fix lint issue

* Fix table tests

* figure out input type based on default value if tpye not explicitly defined

* don't escape ( ) [ ] { }, as they don't cause any issue

Authored-by: Thomas Alton <thomas.alton@gmail.com>
Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
2019-12-20 15:07:29 -05:00
Khosrow Moossavi
f0a7d374a5 Enhance Makefile and add editorconfig (#115) 2019-09-23 20:27:11 +02:00