terraform-linters / tflint

A Pluggable Terraform Linter
Mozilla Public License 2.0
4.86k stars 354 forks source link

Format argument not expected in config file #1400

Closed chris3ware closed 2 years ago

chris3ware commented 2 years ago
config {
  format = "compact"
  plugin_dir = "~/.tflint.d/plugins"

  module              = false
  force               = false
  disabled_by_default = false
}

When running tflint with the above configuration file the following error is displayed in the terminal:

Failed to load TFLint config; ../../../../.tflint.hcl:2,3-9: Unsupported argument; An argument named "format" is not expected here.:

Error: Unsupported argument

  on ../../../../.tflint.hcl line 2:
  (source code not available)

An argument named "format" is not expected here.

If I disable format in the configuration file and pass as a CLI argument it runs just fine.

 tflint --format=compact --config=../../../../.tflint.hcl .
3 issue(s) found:

outputs.tf:3:17: Warning - List items should be accessed using square brackets (terraform_deprecated_index)
outputs.tf:8:17: Warning - List items should be accessed using square brackets (terraform_deprecated_index)
data.tf:1:1: Warning - data "aws_caller_identity" "current" is declared but not used (terraform_unused_declarations)

Version

TFLint version 0.35.0

Terraform v1.0.2

wata727 commented 2 years ago

The format option is added in v0.36.0. Please upgrade the TFLint version.

chris3ware commented 2 years ago

Apologies - should have checked the release notes. Upgraded and working as expected.