terraform_rules: Add workaround for skipping child modules inspection #884
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 #878
This PR adds a workaround to fix false positives in terraform rules.
Module inspection emits an issue in a module argument if an expression contains the module argument. However, this works as expected for rules such as
aws_instance_invalid_type
, but not for rules such asterraform_deprecated_interpolation
, which has no cause in module arguments.In order to avoid such false positives, first, in the rules of terraform, analysis other than the root module is explicitly skipped. This is not a good idea, but the goal is first to avoid false positives.