Commit b0f88bc
authored
Fix MergeYaml Document.End fallback inserting extra blank lines (#7311)
The Document.End prefix fallback introduced in #7291 would copy
trailing whitespace (e.g. a bare newline) as a "comment" prefix
onto newly merged entries, causing an extra blank line in the output.
Only use the Document.End prefix when it actually contains a YAML
comment (has a `#` character). Plain trailing whitespace should not
be treated as a comment to preserve.
Fixes the `SeparateApplicationYamlByProfileTest.mergeIntoExistingProfileFilePreservesFormat`
failure in openrewrite/rewrite-spring.1 parent 5a79346 commit b0f88bc
1 file changed
Lines changed: 7 additions & 2 deletions
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| |||
0 commit comments