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: Avoid validating *.tfvars outside of modules #1447

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Oct 5, 2023

Originally reported in hashicorp/vscode-terraform#1574


Prior to this patch we would consider any folder with *.tfvars as a module. Users may however place *.tfvars files into folders to be loaded anywhere else. In that case we cannot make any assumptions about those *.tfvars files and hence we cannot validate them.

@radeksimko radeksimko force-pushed the b-fix-tfvars-validation branch from 5447aad to cc4613b Compare October 6, 2023 10:35
@radeksimko radeksimko marked this pull request as ready for review October 6, 2023 10:37
@radeksimko radeksimko requested a review from a team as a code owner October 6, 2023 10:37
Comment on lines +69 to 74
if len(mod.ParsedModuleFiles) > 0 {
// Only validate if this is actually a module
// as we may come across standalone tfvars files
// for which we have no context.
pathCtx.Validators = varsValidators
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@radeksimko radeksimko merged commit b81d28d into main Oct 6, 2023
@radeksimko radeksimko deleted the b-fix-tfvars-validation branch October 6, 2023 12:35
Copy link

github-actions bot commented Nov 6, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants