google / google/yamlfmt

Bug: Superfluous comma in flow style

Open
#110 7 comments 10 reactions 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

Version: `latest`

To reproduce:

`printf "---\n- {foo: bar}\n\n" | yamlfmt -formatter "include_document_start=true" -formatter "retain_line_breaks=true" -`

Actual Input:
```yaml
---
- {foo: bar}

```

Actual Output:
```yaml
---
- {foo: bar,}

```

Expected Output:
```yaml
---
- {foo: bar}

```

---

Also note that the following works fine:

`printf "---\n- {foo: bar}\n" | yamlfmt -formatter "include_document_start=true" -formatter "retain_line_breaks=true" -`

Thanks for your work on this!

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.