Copy internal packages from Terraform v1.0 #1141
Merged
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.
Fixes #937
This PR is the first step in removing dependencies on Terraform's internal packages from TFLint.
First, copy packages required by TFLint to
github.com/terraform-linters/tflint/terraform
from Terraform v1.0. This includes some redundant code, but I'll ignore it here as it focuses on removing dependencies without changing the TFLint's interface.This copy adds the following packages:
Not all the code in the package has been copied, it contains only the minimum files needed to build.
These packages are huge and it's hard to keep everything as maintained as the Terraform core team. I then remove as much apparently redundant code as possible (for example, GraphBuilder isn't needed to simulate Terraform Language semantics) and slim down the copied packages.
In addition, we should be able to minimize the required packages by changing some interfaces. See #937 (comment) for details.
The copied code does not include tests, but I plan to add it as needed as we make changes in the future.