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

Add a check for specific version of a tool before applying a hook #246

Closed
antonbabenko opened this issue Oct 15, 2021 · 4 comments
Closed
Labels
estimate/4h Need 4 hours to be done feature New feature or request hook/terraform_docs Bash hook

Comments

@antonbabenko
Copy link
Owner

What problem are you facing?

It would be helpful to be able to set hard requirements on the version of certain tools (e.g. terraform-docs) inside the YAML config so that the hook fails&stops if the version mismatches at the very beginning.

How could pre-commit-terraform help solve your problem?

Potential config:

- id: terraform_docs
  args:
    - TERRAFORM_DOCS_ALLOWED_VERSION_REGEXP="0.13.[0-9]+"
    - tfvars hcl --output-file terraform.tfvars.model .

I think it should be applied to terraform_docs hooks first of all.

Ref: https://tldp.org/LDP/abs/html/bashver3.html#REGEXMATCHREF

@antonbabenko antonbabenko added feature New feature or request hook/terraform_docs Bash hook labels Oct 15, 2021
@antonbabenko antonbabenko changed the title Add check for specific version of utilities to be installed Add a check for specific version of a tool before applying a hook Oct 15, 2021
@MaxymVlasov MaxymVlasov added the estimate/4h Need 4 hours to be done label Oct 15, 2021
@mohitsaxenaknoldus
Copy link
Contributor

Can I work on this?

@MaxymVlasov
Copy link
Collaborator

@mohitsaxenaknoldus yes

@MaxymVlasov
Copy link
Collaborator

Maybe not needed if #188 will be implemented

@antonbabenko
Copy link
Owner Author

I agree. There is no need for this anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate/4h Need 4 hours to be done feature New feature or request hook/terraform_docs Bash hook
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants