terraform_docs_replace should support --header-from for reading doc headers from files other than main.tf #177
Labels
estimate/2h
Need 2 hours to be done
feature
New feature or request
good first issue
Good for newcomers
hook/terraform_docs_replace
Python hook
stale
Denotes an issue or PR has remained open with no activity and has become stale.
terraform-docs itself supports the
header-from
option on the command line or in its config file. This defaults to a value ofmain.tf
, which works fine with this project's terraform_docs_replace hook.However, if using a different value of
header-from
that does not end in .tf (or .tfvars, but that would be... strange) , such asdoc_header.md
, then the logic on (currently) line 33 of terraform_docs_replace..py means that a change to the header file will not result in README.md being recreated.My proposal to resolve this is to add an argparse argument to
terraform_docs_replace.py
named--header-from
, defaulting tomain.tf
, and amend the logic near line 33 so that a supplied value of that argument (if it doesn't end in .tf), also gets added to the list.If this sounds reasonable, I will submit a PR to that effect.
The text was updated successfully, but these errors were encountered: