google / google/yamlfmt

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

Open
#263 2 comments 1 reaction 0 assignees View on GitHub
yaml_v3_problem
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.