Switch to file directory for terraform-fmt check #97
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.
Description
Problem
When using
tfenv
,terraform
executable might resolve to different Terraform versions, depending on the directory where it runs (e.g. via using.terraform-version
files).At the moment, the
terraform-fmt
check runsterraform fmt
from the repository root, and in some cases (e.g. when all Terraform configuration along with.terraform-version
is in a subfolder) it might even mean that no valid Terraform version is configured.Proposed solution
For
terraform-fmt
check, switch to the directory of the Terraform file we're checking (similarly to what happens in terraform-hclfmt and terraform-validate checks). This will ensure that the right Terraform version is picked up if tools liketfenv
are used.Documentation
TODOs
Please ensure all of these TODOs are completed before asking for a review.
feature/new-vpc-endpoints-955
orbug/missing-count-param-434
.Related Issues