Skip to content

Report & fix colons : as attribute/value separators #1558

Open
@radeksimko

Description

@radeksimko

Background

It is possible to write map/object in two different ways:

locals {
  one = {
    foo : "bar"
  }
  two = {
    foo = "bar"
  }
}

The equal sign is considered best practice separator, which is supported by that separator being used when objects/maps are rendered by Terraform CLI and also by majority of existing configuration in docs and elsewhere using this separator.

Proposal

  • Report : as attribute/value separators as a informative or warning diagnostic (perhaps warning is too much given that this is purely stylistic problem which does not impact functionality)
  • Provide quick fix code action which resolves the diagnostic by turning colon into equal sign

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions