Skip to content

Recent update broke comments in arrays in TOML #2592

@Artemigos

Description

@Artemigos

Describe the bug
I had a config TOML file with comments in arrays like this:

[section]
the_array = [
  # comment
  "value 1",

  # comment
  "value 2",
]

This broke when running yq . -oj ~/tmp/yq-bug.toml and is now reporting:

Error: bad file '[file path here]': unsupported type Comment

Running without -oj has the same problem.

Version of yq: 4.52.2
Operating system: linux
Installed via: binary release

Additional context
I wasn't sure if this syntax is even supported, but according to spec it is: https://toml.io/en/v1.1.0#:~:text=Any%20number%20of%20newlines%20and%20comments%20may%20precede%20values%2C%20commas%2C%20and%20the%20closing%20bracket%2E

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions