pre-commit-terraform
pre-commit-terraform copied to clipboard
Allow to specify the version of terraform-docs for the hook to use
Currently, terraform_docs (and similar) hooks will use the version of terraform-docs installed on the system.
With each major release of the terraform-docs the output format changes and users need to regenerate the docs.
We need to be able to pin a specific version in the hook so that we have more control over README.md.
Proposal:
- Use
argsto define a specific version of docker image - https://terraform-docs.io/user-guide/installation/#docker
Sample:
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.48.0
hooks:
- id: terraform_fmt
- id: terraform_docs
args: ['--version=0.12']
@bryantbiggs I just want to link this one with the PR (eg, https://github.com/terraform-aws-modules/terraform-aws-alb/pull/190 ).
Alternatively, you can directly use terraform-docs' version constraints instead of implementing the functionality in this pre-commit hook.
Yes, this is a good option. If it would be implemented in pre-commit-terraform maybe we can also take care of installing the required version (not sure if it is a good idea though).
In my opinion, since using .terraform-docs.yml as a single source for configuration becomes more popular it makes sense to delegate these kind of configurations and restrictions to terraform-docs itself. But on the other hand installing the required version as part of the hook is gonna be very useful I think.
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days