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

Ignore invalid references in referencesInExpr #1478

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Aug 11, 2022

Fixes #1474

All expressions are now handled by WalkExpressions in #1432, so there are cases where reference parsing fails. For example, ignore_changes contains various keywords, which are invalid references.

Often these keywords are not expected and are ignored by referencesInExpr. However, if the name conflicts with an existing reference such as data or terraform, it may be misidentified as a valid reference and fail to parse.

This PR changes it so that it doesn't return diagnostics if it fails to parse, even for valid references like data and terraform. This might make it impossible to detect errors in valid references, but checking references is not the responsibility of this rule, so it makes sense to ignore them here.

@wata727 wata727 merged commit 9bcc0e6 into master Aug 12, 2022
@wata727 wata727 deleted the fault_tolerant_ref_parser branch August 12, 2022 06:17
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.

"invalid reference" error with lifecycle.ignore_changes
1 participant