Open
Description
Describe the bug
When setting headComment, the comment is added after the field or inside the object instead of being prepended above the field.
Version of yq: 4.7.0 (also failed on 4.5.1)
Operating system: mac
Installed via: homebrew
Example 1
Input Yaml
foo:
default: bar
description: baz
Command
yq e -P '.[] headComment |= .description | .[] |= .default'
Actual behavior
foo: bar
# baz
Expected behavior
# baz
foo: bar
Example 2:
Input Yaml
foo:
default:
qux: quo
description: baz
Command
yq e -P '.[] headComment |= .description | .[] |= .default'
Actual behavior
foo:
# baz
qux: quo
Expected behavior
# baz
foo:
qux: quo