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

Make individual validators configurable #1605

Open
radeksimko opened this issue Oct 24, 2023 · 0 comments
Open

Make individual validators configurable #1605

radeksimko opened this issue Oct 24, 2023 · 0 comments
Labels
diagnostics enhancement New feature or request

Comments

@radeksimko
Copy link
Member

Background

We introduced enhanced validation in hashicorp/terraform-ls#1368 We took care to only focus on 100% wrong syntax and avoid opinionated validation, such that users do not feel the need to tweak anything about this configuration and what's highlighted as wrong is always "indisputably wrong".

We have received feedback from folks who use some techniques and tools to effectively produce "expected invalid configuration". While this is not something we intend to support and users were advised to simply stop producing invalid configuration, there are some pragmatic steps we can take to still provide some validation to those users, rather than making them turn it off entirely.

See

Proposal

Introduce new boolean settings options under terraform.validation section, for example terraform.validation.unexpectedAttribute or terraform.validation.unreferencedOrigins etc. to allow the users to turn each validator on or off.

Stretch goal - File Filtering

We could also consider accepting glob patterns or file paths to include/exclude but this would need to be considered carefully. I'm sure we have had this request before for other reasons and I think we should 1st understand why people would really want this.

By making exclusion/inclusion a validation only feature just hides the most visible problem but leaves users exposed to other IDE features (completion, hover etc.) which are also powered by all the same data as validation and if users wan't to turn off validation for particular files because the data to support the validation is unavailable or inaccurate then we should consider this as a more holistic feature and turn on/off the other IDE help too, not just validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant