docs: warn that .terraform.lock.hcl corrupts terraform-docs README output - #44
Open
akuzminsky wants to merge 1 commit into
Open
docs: warn that .terraform.lock.hcl corrupts terraform-docs README output#44akuzminsky wants to merge 1 commit into
akuzminsky wants to merge 1 commit into
Conversation
…tput When a lock file exists in the module root, terraform-docs writes resolved provider versions into README's Providers table instead of the constraints from terraform.tf, and the pre-commit hook silently stages the regenerated README during commit. Document the pitfall and the safe validation workflow in CODING_STANDARD.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Comment was too big. Check the CI workflow output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CRITICAL note to the centrally-managed
CODING_STANDARD.md(Terraform → Documentation section)documenting a pitfall that has now bitten twice (terraform-aws-iso27001, terraform-aws-pypiserver PR #45):
.terraform.lock.hclexists in a module root, terraform-docs writes resolved provider versions(e.g.
6.60.0) into README's Providers table instead of the constraints fromterraform.tf(e.g.
>= 5.11, < 7.0.0).git commitand silently stages the change, so thecommitted diff can differ from the reviewed diff.
The new guidance: run
terraform initin the test root (test_data/<module>/) rather than the module root,clean up init artifacts before committing, and verify the committed diff with
git show --stat.Since
CODING_STANDARD.mdis injected into all managed repos viagithub_repository_file, the terraform planwill show updates across every repository — that's the intended propagation.
🤖 Generated with Claude Code