Add indentation to flow values on new lines (#759)

This commit is contained in:
Shuhei Kitagawa 2025-11-29 03:43:49 +01:00 committed by GitHub
parent 0040ab4161
commit 07c09c0287
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 61 additions and 2 deletions

View file

@ -290,6 +290,30 @@ r: s
- b
- c - d - e
- f
`,
},
{
`
elem1:
- elem2:
{a: b, c: d}
`,
`
elem1:
- elem2:
{a: b, c: d}
`,
},
{
`
elem1:
- elem2:
[a, b, c, d]
`,
`
elem1:
- elem2:
[a, b, c, d]
`,
},
{
@ -1520,6 +1544,32 @@ foo2: &anchor text # anchor comment
# foo3 comment
# foo3 comment2
foo3: *anchor # alias comment
`,
},
{
name: "flow map with inline key comment",
yaml: `
elem1:
- elem2: # comment
{a: b, c: d}
`,
expected: `
elem1:
- elem2: # comment
{a: b, c: d}
`,
},
{
name: "flow sequence with inline key comment",
yaml: `
elem1:
- elem2: # comment
[a, b, c, d]
`,
expected: `
elem1:
- elem2: # comment
[a, b, c, d]
`,
},
{