New line issues with comments on Windows with CRLF EOL
Open
- 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
Assessment
This issue has not been assessed yet.