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

feat(terraform_docs): Start seamless migration to terraform-docs markers #701

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

MaxymVlasov
Copy link
Collaborator

Put an x into the box if that apply:

  • This PR introduces breaking change.
  • This PR fixes a bug.
  • This PR adds new functionality.
  • This PR enhances existing functionality.

Description of your changes

In #699 was mentioned that v1.92.2 break unexpected behavior which requires to be set - --hook-config=--create-file-if-not-exist=true.

Because we want:

  • to set - --hook-config=--create-file-if-not-exist=true in v2 as one possible solution
  • do not ask folks with broken configs to introduce config line which should be removed in the future

I decided that this a time to start gradually switching folks to standard terraform-docs markers

Relates #699

How can we test changes

repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: e5209b3b0b27a5c7aea11aac86a93dfff1f0ac21
    hooks:
      - id: terraform_docs
        args:
          - --hook-config=--use-standard-markers=true

hooks/terraform_docs.sh Outdated Show resolved Hide resolved
@MaxymVlasov
Copy link
Collaborator Author

And maybe worth to check terraform-socs config provided to hook in case it uses output.template with pre-commit-terraform markers

And if we change this config, maybe remove obsolote --hook-config in pre-commit-config.yaml make sense too?

README.md Outdated Show resolved Hide resolved
hooks/terraform_docs.sh Outdated Show resolved Hide resolved
hooks/terraform_docs.sh Outdated Show resolved Hide resolved
hooks/terraform_docs.sh Outdated Show resolved Hide resolved
Co-authored-by: George L. Yermulnik <[email protected]>
@MaxymVlasov MaxymVlasov requested a review from yermulnik August 28, 2024 12:40
@MaxymVlasov MaxymVlasov merged commit d03f44f into master Aug 28, 2024
5 checks passed
@MaxymVlasov MaxymVlasov deleted the feat/GH-699/migrate_to_standart_markers branch August 28, 2024 17:17
antonbabenko pushed a commit that referenced this pull request Aug 28, 2024
# [1.93.0](v1.92.3...v1.93.0) (2024-08-28)

### Features

* **`terraform_docs`:** Start seamless migration to `terraform-docs` markers ([#701](#701)) ([d03f44f](d03f44f))
@antonbabenko
Copy link
Owner

This PR is included in version 1.93.0 🎉

cschroer added a commit to cschroer/pre-commit-terraform that referenced this pull request Aug 29, 2024
Ensure compatibility of `terraform_docs` hook on MacOS and Linux by using GNU sed.

In PR antonbabenko#701, the `terraform_docs` hook uses `sed` for in-file changes. MacOS requires an extension for the `-i` parameter, unlike GNU sed. The solution is to use GNU sed on both MacOS and Linux to ensure consistent behaviour across operating systems.
cschroer added a commit to cschroer/pre-commit-terraform that referenced this pull request Aug 29, 2024
Ensure compatibility of `terraform_docs` hook on MacOS and Linux by using GNU sed.

In PR antonbabenko#701, the `terraform_docs` hook uses `sed` for in-file changes. MacOS requires an extension for the `-i` parameter, unlike GNU sed. The solution is to use GNU sed on both MacOS and Linux to ensure consistent behaviour across operating systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants