terraform-linters / tflint

A Pluggable Terraform Linter
Mozilla Public License 2.0
4.96k stars 357 forks source link

Compact format option is ignored #1460

Closed laughedelic closed 2 years ago

laughedelic commented 2 years ago

Introduction

It seems like -f compact formatting is ignored. It outputs the same as default. Other options like -f json or -f sarif seem to work fine.

Expected Behavior

One-line per error output when using tflint -f compact

Actual behavior

►  tflint --init
Plugin `google` is already installed

►  tflint -f compact
Failed to load configurations; example.tf:3,16-4,1: Invalid expression; Expected the start of an expression, but found an invalid expression token.:

Error: Invalid expression

  on example.tf line 3, in module "example":
   3:   version    =
   4:   project_id = var.project_id

Expected the start of an expression, but found an invalid expression token.

As you can see it prints full output, same as with -f default.

Step to Reproduce

Example file in the current directory: example.tf:

module "example" {
  source     = "..."
  version    = 
  project_id = var.project_id
}

Additional Context

►  tflint -v
TFLint version 0.39.1
+ ruleset.google (0.18.0)
►  terraform -v
Terraform v1.2.6
on darwin_arm64
bendrucker commented 2 years ago

The compact format does not reformat errors when loading configuration.