You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, TFLint treats .tflint.hcl as a special case for --config. It's the default, and even when the referenced file does not exist TFLint ignores that. This can cause confusion for users who think they are specifying config but actually have no .tflint.hcl file in their module, particularly when combined with --recursive or --chdir. The docs are already pretty clear about how configuration files are resolved but users often don't read or understand this caveat.
Proposal
The default value of --config should be empty. TFLint can continue to automatically attempt to auto-load .tflint.hcl if no explicit configuration path is provided. But when --config .tflint.hcl is explicitly passed, TFLint should exit with an error if the file does not exist in the module directory.
While this change could break users relying on that config being ignored in certain modules, those users should be omitting --config entirely if they truly want automatic and optional config loading in each module. Otherwise, this change only "breaks" in the sense that it correct a past divergence between intended and actual configuration.
Exactly. I just wasted 30 mins on this trying to work out why my rules were not being followed! I almost gave up but decided to Google it and then found this discussion which linked here. I know there's some related technical discussion in #1929 but most users, like myself, expect have a quick read of the --help output and for it to function like other tools. And I would say this should work:
Introduction
Currently, TFLint treats
.tflint.hcl
as a special case for--config
. It's the default, and even when the referenced file does not exist TFLint ignores that. This can cause confusion for users who think they are specifying config but actually have no.tflint.hcl
file in their module, particularly when combined with--recursive
or--chdir
. The docs are already pretty clear about how configuration files are resolved but users often don't read or understand this caveat.Proposal
The default value of
--config
should be empty. TFLint can continue to automatically attempt to auto-load.tflint.hcl
if no explicit configuration path is provided. But when--config .tflint.hcl
is explicitly passed, TFLint should exit with an error if the file does not exist in the module directory.While this change could break users relying on that config being ignored in certain modules, those users should be omitting
--config
entirely if they truly want automatic and optional config loading in each module. Otherwise, this change only "breaks" in the sense that it correct a past divergence between intended and actual configuration.References
The text was updated successfully, but these errors were encountered: