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

Merge terraform_docs_replace functionality to terraform_docs #248

Closed
MaxymVlasov opened this issue Oct 15, 2021 · 7 comments · Fixed by #451
Closed

Merge terraform_docs_replace functionality to terraform_docs #248

MaxymVlasov opened this issue Oct 15, 2021 · 7 comments · Fixed by #451
Labels
feature New feature or request hook/terraform_docs_replace Python hook hook/terraform_docs Bash hook

Comments

@MaxymVlasov
Copy link
Collaborator

What problem are you facing?

It's mostly the same hooks, that need to be maintained separately.

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

Decrease maintainability flow, like this #177

@MaxymVlasov MaxymVlasov added feature New feature or request hook/terraform_docs Bash hook hook/terraform_docs_replace Python hook labels Oct 15, 2021
@MaxymVlasov MaxymVlasov changed the title Merge terraform_docs_replace to terrafrom_docs Merge terraform_docs_replace functionality to terrafrom_docs Oct 15, 2021
@MaxymVlasov MaxymVlasov changed the title Merge terraform_docs_replace functionality to terrafrom_docs Merge terraform_docs_replace functionality to terraform_docs Oct 29, 2021
@adamantike
Copy link

If this idea is already accepted, can it have a short-term fix to mark terraform_docs_replace as deprecated? I started using these hooks last week, and went with terraform_docs_replace because of wanting for the Readme to be completely managed by it. However, right now, the shortcomings of going with this hook aren't listed (mainly, unsupported terraform-docs flags).

@sharkymcdongles
Copy link

Can you please document how to use terraform_docs hook to have identical behavior to terraform_docs_replace since it is now deprecated? I couldn't seem to find any documentation on this as you'd expect with a deprecation.

@MaxymVlasov
Copy link
Collaborator Author

MaxymVlasov commented Mar 2, 2022

Hi, sure we do. But for me, firstly need to understand what the terraform_docs_replace hook does.
Those plans were postponed during all our team members now at war with Russia, during their full-scale invasion of our homeland, Ukraine.
So, it deprecated, but not to be removed until summer, I guess.

Feel free to send your PR with this doc

@sharkymcdongles
Copy link

Hi, sure we do. But for me, firstly need to understand what the terraform_docs_replace hook does. Those plans were postponed during all our team members now at war with Russia, during their full-scale invasion of our homeland, Ukraine. So, it deprecated, but not to be removed until summer, I guess.

Feel free to send your PR with this doc

I didn't know they were from there. I will try and understand how it works with some testing on my end and submit some docs then. Slava Ukraini!!!

@carlosjgp
Copy link

carlosjgp commented Oct 25, 2022

This is how I did replicate the functionality of terraform_docs_replace with terraform_docs

Add .terraform-docs.yml to the root of the project

formatter: "markdown"

output:
  file: "README.md"
  mode: replace
  template: |-
    {{ .Content }}
    {{/** End of file fixer */}}

Update the hook version

repos:
  - repo: https:/antonbabenko/pre-commit-terraform
    rev: v1.76.0
    hooks:
      - id: terraform_docs
        args:
          - --args=--config=.terraform-docs.yml

Other versions
Terraform: 1.3.2
terraform-docs: terraform-docs version v0.16.0 1f686b1 linux/amd64

@MaxymVlasov
Copy link
Collaborator Author

MaxymVlasov commented Nov 4, 2022

@carlosjgp Amazing!
Now we can add .terraform-docs.yml instructions to README, and print out the link to the replacement instruction ( https:/antonbabenko/pre-commit-terraform/issues/248#issuecomment-1290829226) in terraform_docs_replace hook here

Would you like to make PR? If not - I'll create it

@antonbabenko
Copy link
Owner

This issue has been resolved in version 1.76.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request hook/terraform_docs_replace Python hook hook/terraform_docs Bash hook
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants