google / google/yamlfmt

New line issues with comments on Windows with CRLF EOL

Open
#192 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

With the following yaml with a proper newline at EOF on Windows:
```yaml
k:
- a: 1
# abcd
b: 2
```
`yamlfmt` seems to always want to add an unnecessary new line after the comment:
```powershell
PS> del $env:USERPROFILE/go/bin/yamlfmt.exe
PS> go install github.com/google/yamlfmt/cmd/yamlfmt@main
PS> & "$env:USERPROFILE/go/bin/yamlfmt" --version
yamlfmt dev (none)
PS> & "$env:USERPROFILE/go/bin/yamlfmt" -lint test.yaml
The following formatting differences were found:

test.yaml:
k: k:
- a: 1 - a: 1
# abcd # abcd
+
b: 2 b: 2

```

I don't set up any format configurations. This issue is probably related to #34.

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.