Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support -html flag to render output as HTML #70

Merged
merged 5 commits into from
Mar 9, 2024
Merged

Conversation

mdb
Copy link
Contributor

@mdb mdb commented Mar 1, 2024

This addresses issue #69 to support HTML output.

This also...

  • updates the README usage docs
  • validates that multiple, conflicting format flags are not provided
  • fixes a bug in the tests to properly validated expected errors invoking tf-summarize
  • improves the tf-summarize tests to exercise the tool's ability to summarize changes to outputs (as well as resources)
  • improves make help to output documentation for all Makefile targets
  • improve test accuracy via -count flag, protecting against false positives in go test runs

Seed plant for the future: Ultimately, it might be preferable to support a single -format="json|md|html|table" flag, though I was hesitant to do so in this PR and break tf-summarize's existing usage in a non-backwards-compatible fashion.

This addresses issue #69 to support HTML output.

This also...

- updates the README usage docs
- validates that multiple, conflicting format flags are not provided
- fixes a bug in the tests to properly validate expected tf-summarize errors

Signed-off-by: Mike Ball <mikedball@gmail.com>
mdb added 4 commits March 2, 2024 06:43
Previously, the tf-summarize tests did not exercise the tool's ability
to summarize plan outputs. This fixes that!
By adding a code comment in association with all Make targets, `make
help` now documents all targets:

```
$ make help
build                          build the binary
example                        generate example Terraform plan
help                           prints help (only for tasks with comment)
i                              build and install to /usr/local/bin/
install                        build and install to /usr/local/bin/
lint                           lint source code
test                           go test
```
This makes the HTML output a bit more consistent with output elsewhere.
This protects against false positives running the tests.
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
README.md Show resolved Hide resolved
writer/html.go Show resolved Hide resolved
writer/table.go Show resolved Hide resolved
@mdb
Copy link
Contributor Author

mdb commented Mar 3, 2024

👋 Hi @dineshba - I'm curious to hear your thoughts about this PR!

@dineshba dineshba merged commit c447ded into dineshba:main Mar 9, 2024
1 check passed
@dineshba dineshba mentioned this pull request Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants