Ignore inputs with terraform-docs-ignore comment #651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
In our monorepo projects, we often have a set of variables that is shared amongst modules, eg. a
tags
variable that is accepted by all modules in the repo. This is typically done by symlinking acommon-vars.tf
file into all modules in the repo. This leads to those documentation these inputs being generated on every modules documentation.This is not only rather repetitive, it also clutters the documentation by mixing the module specific inputs with the common ones, making it harder to read the module docs.
This PR introduces the possibility to add a comment
# terraform-docs-ignore
to a variable, tellingterraform-docs
to ignore and not render the variable in the documentation.Example:
I have:
make test
.How has this code been tested
The unit test shows that the variable tagged with
# terraform-docs-ignore
is not present after loading the module.