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

fix(terraform_docs): Restore --hook-config=--add-to-existing-file default behavior. Regression from 1.94.0. #716

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

MaxymVlasov
Copy link
Collaborator

@MaxymVlasov MaxymVlasov commented Sep 9, 2024

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

Fixes #715

How can we test changes

broken:

testdir=$(mktemp -d)
cd $testdir
touch main.tf README.md
echo "
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.94.2 # issue introduced in 1.94.0
    hooks:
      - id: terraform_docs
" > .pre-commit-config.yaml
git init
git add -A
pre-commit run

fixed:

testdir=$(mktemp -d)
cd $testdir
touch main.tf README.md
echo "
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: c0b1f38bae3b34f3f223bc73a8b384e2e7a766d7
    hooks:
      - id: terraform_docs
" > .pre-commit-config.yaml
git init
git add -A
pre-commit run
testdir=$(mktemp -d)
cd $testdir
touch main.tf README.md
echo "
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: c0b1f38bae3b34f3f223bc73a8b384e2e7a766d7
    hooks:
      - id: terraform_docs
        args:
        - --hook-config=--add-to-existing-file=true
" > .pre-commit-config.yaml
git init
git add -A
pre-commit run

@MaxymVlasov MaxymVlasov added bug Something isn't working hook/terraform_docs Bash hook labels Sep 9, 2024
@MaxymVlasov MaxymVlasov changed the title fix(terraform_docs): Restore --hook-config=--add-to-existing-file default behavior. Regression from 1.94.0. fix(terraform_docs): Restore --hook-config=--add-to-existing-file default behavior. Regression from 1.94.0. Sep 9, 2024
hooks/terraform_docs.sh 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
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
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
MaxymVlasov and others added 2 commits September 9, 2024 23:06
Co-authored-by: George L. Yermulnik <[email protected]>
Co-authored-by: George L. Yermulnik <[email protected]>
@MaxymVlasov MaxymVlasov merged commit 315342e into master Sep 10, 2024
5 checks passed
@MaxymVlasov MaxymVlasov deleted the fix/GH-715 branch September 10, 2024 17:53
antonbabenko pushed a commit that referenced this pull request Sep 10, 2024
## [1.94.3](v1.94.2...v1.94.3) (2024-09-10)

### Bug Fixes

* **`terraform_docs`:** Restore `--hook-config=--add-to-existing-file` default behavior. Regression from 1.94.0. ([#716](#716)) ([315342e](315342e))
@antonbabenko
Copy link
Owner

This PR is included in version 1.94.3 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hook/terraform_docs Bash hook
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform_docs starting from 1.94.0 ignores --hook-config=--add-to-existing-file=false (our default behavior)
4 participants