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

Allow to specify the version of terraform-docs for the hook to use #188

Open
antonbabenko opened this issue Mar 26, 2021 · 5 comments
Open
Labels
area/local_installation estimate/2days Need 2 work days to be done help wanted Extra attention is needed hook/terraform_docs Bash hook hook/terraform_tflint Bash hook

Comments

@antonbabenko
Copy link
Owner

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:

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']
@antonbabenko antonbabenko added the help wanted Extra attention is needed label Mar 26, 2021
@antonbabenko antonbabenko pinned this issue Mar 26, 2021
@antonbabenko
Copy link
Owner Author

@bryantbiggs I just want to link this one with the PR (eg, terraform-aws-modules/terraform-aws-alb#190 ).

@khos2ow
Copy link
Contributor

khos2ow commented Jun 9, 2021

Alternatively, you can directly use terraform-docs' version constraints instead of implementing the functionality in this pre-commit hook.

@antonbabenko
Copy link
Owner Author

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).

@khos2ow
Copy link
Contributor

khos2ow commented Jun 9, 2021

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.

@github-actions
Copy link

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

@github-actions github-actions bot added the stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2021
@MaxymVlasov MaxymVlasov removed the stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/local_installation estimate/2days Need 2 work days to be done help wanted Extra attention is needed hook/terraform_docs Bash hook hook/terraform_tflint Bash hook
Projects
None yet
Development

No branches or pull requests

3 participants