Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect formatter_trailing_comma finding with lists of objects #35

Open
fatbasstard opened this issue Sep 4, 2023 · 4 comments
Open

Comments

@fatbasstard
Copy link
Contributor

HI,

Encountered an invalid finding on the formatter_trailing_comma rule when a list of objects. Encountered this with a local module.

Broken in to a small test setup:

module/test/variables.tf:

variable "columns" {
  type = list(object({
    name = string,
    type = string,
  }))
  default     = []
  description = "XXX"
}

terraform/comma_test.tf:

module "comma_test" {
  source = "../comma_test"
  columns = [
    { name = "name", type = "string" },
    { name = "code", type = "string" },
  ]
}

TFLint output:

terraform/comma_test.tf:3:13: Warning - List value should end with a comma (actual: 4, expected: 2) (formatter_trailing_comma)
@fatbasstard
Copy link
Contributor Author

Could be as simple as adding a "the amount of comma's have to be less than the amount expected". 🤔

@fatbasstard
Copy link
Contributor Author

Hi @thaim ,

Had a chance to look at this one already?

@fatbasstard
Copy link
Contributor Author

Hi @thaim , Got a chance to look at it already?

@fatbasstard
Copy link
Contributor Author

Another nice bump after 9 months of no response (and almost 1 year of the ticket being there.

Any news on this @thaim ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant