Skip to content

Comments in lists are handled differently on Linux and Windows, when using retain_line_breaks_single #263

@kiraacorsac

Description

@kiraacorsac

I'm using the same .ymlfmt file on both platforms. I am using fresh installation via $ go install github.com/google/yamlfmt/cmd/yamlfmt@latest on both platforms.

formatter:
  type: basic
  retain_line_breaks_single: true # retain_line_breaks also triggers this bug

This results in the following .yaml file being formatted differently

nav:
  - Home:
      - Welcome: index.md
      - Back to Documentation Index: index.md
    # - Download Now: index.md
  - Troubleshooting:
      - Support: troubleshooting/support.md
      - FAQ: troubleshooting/faq.md

On windows the file stays unchanged.

On linux, the file gets formatted like this:

nav:
  - Home:
      - Welcome: index.md
      - Back to Documentation Index: index.md
        # - Download Now (Superhive): index.md
  - Troubleshooting:
      - Support: troubleshooting/support.md
      - FAQ: troubleshooting/faq.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    yaml_v3_problemA bug in the underlying yaml library. These issues are vastly harder to fix.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions