google / google/yamlfmt

scan_folded_as_literal not behaving plausible with trailing whitespace

Open
#153 4 comments 3 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

Config:
```
formatter:
type: basic
scan_folded_as_literal: true
```

Minimal reproducible example:

```yaml
foo: >
lorem ipsum
```

(note there is a trailing whitespace after "lorem ipsum ")

is being formatted to

```yaml
foo: "lorem ipsum \n"
```

It took me quite a while to figure out that this is the underlying reason why our 20+ line folded strings got turned into single lines. So I guess that this behaviour is for the very least misleading and probably also not desired.

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.