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

Replace config loader with a new loader #1428

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Replace config loader with a new loader #1428

merged 1 commit into from
Jul 26, 2022

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Jul 3, 2022

This PR replaces the current config loader that depends on the Terraform internal APIs with a new loader. The new loader decodes the minimum required configuration, so this is making it more robust against schema changes due to new Terraform features. Also, a minimal code base improves maintainability.

An important change is the position of the terraform package. Previously, the terraform package was treated as a copy of the Terraform internal packages, but now it is a unique package that reproduces Terraform semantics.

By extending this package, we can add unique features for TFLint while preserving Terraform semantics. for example,

  • Extended module loader enables inspection of local modules without running terraform init.
  • Extended config loader allow inspections that are not limited to a single directory (e.g. recursive inspection).
  • Extended evaluator gives you fine control over the evaluation of context-sensitive expressions such as path.*.

This PR is the first step towards realizing these features.

In this change, we will try to keep the Loader interface as much as possible. Ideally, the new terraform package could be used to bring together concerns about other Terraform semantics, but that's a future improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant