oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.9k stars 231 forks source link

TFLint - deprecated argument in ".tflint.hcl" #3618

Closed mg-alanjones closed 3 months ago

mg-alanjones commented 3 months ago

Describe the bug The default .tflint.hcl is using a deprecated argument. See screenshots below. The error message occurs for each error that TFLint finds, meaning it can get quite lengthy if there are lots of errors.

Potential solutions are:

  1. Change module = false to call_module_type = "none"
  2. Remove module = false, which means by default it will be call_module_type = "local"

To Reproduce Steps to reproduce the behavior:

  1. Run TFLint in MegaLinter.

Expected behavior This error should not occur because the argument should be updated.

Screenshots

❌ Linted [TERRAFORM] files with [tflint]: Found 1 error(s) - (7.58s) (expand for details)
- Using [tflint v0.51.1] https://megalinter.io/7.12.0/descriptors/terraform_tflint
- MegaLinter key: [TERRAFORM_TFLINT]
- Rules config: [.tflint.hcl]
[Pre][TERRAFORM_TFLINT] run: [tflint --init --config /action/lib/.automation/.tflint.hcl] in cwd [/]
[Pre][TERRAFORM_TFLINT] result:
WARNING: "module" attribute in /action/lib/.automation/.tflint.hcl is deprecated. Use "call_module_type" instead.
Installing "aws" plugin...
Installed "aws" (source: github.com/terraform-linters/tflint-ruleset-aws, version: 0.31.0)
mg-alanjones commented 3 months ago

Also the line 1 comment link in the .tflint.hcl is dead. I believe it should be https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/config.md.

echoix commented 3 months ago

What do you think should be used a default config file for projects not having any config done yet?

mg-alanjones commented 3 months ago

Sorry, not sure what you mean. I meant the argument name should be updated. Rest of the configuration can stay as it is.

echoix commented 3 months ago

What do you think is the better option?

mg-alanjones commented 3 months ago

I think it should be changed to call_module_type = "local", local modules should be scanned.

echoix commented 3 months ago

Let's go with that then!