mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-21 10:47:34 -05:00
This generalizes the previously-added lint-like check for when an object constructor is used to define an input variable and it contains a definition for an attribute that isn't part of the target type, so that now it also works for various nested structures that commonly arise in real-world configurations. Because this is now considerably more complicated I factored it out into a new package called "lint" which could potentially grow to include other similar "technically valid but probably a mistake" situations in future, but for now it just introduced an opportunity to produce similar warning messages for ignored attribute definitions in the default value for an input variable. It seems to me that there is actually no useful reason to include an unexpected attribute definition in either of these two cases: that attribute will never appear as part of any expression that any other part of the configuration can use. Therefore I considered making these be treated as errors rather than warnings, but turning something that was previously valid into an error is risky so I'm suggesting that we start with these as warnings and then consider upgrading them to errors in a later release if we don't hear of anyone reporting a false-positive that was _somehow_ actually useful. (I find that very unlikely, but still...) Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
532 B
532 B