You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When appending to array an extra newline is appended before the new element if the last element in the array is commented out at the indentation level where the - would be.
This does no harm, reporting in case it reflects a parsing bug that is problematic in some other scenario.
version of yq: 3.3.2 (installed w/ Homebrew)
operating system: macOS 10.15.6
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug)
data.yml:
b:
c: 2d:
- new thing# - foo thing
Command
The command you ran:
yq w data.yaml "b.d[+]""bar thing"
Actual behavior
b:
c: 2d:
- new thing# - foo thing
- bar thing
Expected behavior
b:
c: 2d:
- new thing# - foo thing
- bar thing
or
b:
c: 2d:
- new thing
- bar thing# - foo thing
Additional context
Compare to when the # is in a different position. In all cases the command is the same
b:
c: 2d:
- new thing# - foo thing
% yq w git-replay.yaml "b.d[+]""bar thing"
b:
c: 2
d:
- new thing
- bar thing
# - foo thing
and
b:
c: 2d:
- new thing# - foo thing
b:
c: 2
d:
- new thing
- bar thing
# - foo thing
and
b:
c: 2d:
- new thing# - foo thing
% yq w git-replay.yaml "b.d[+]""bar thing"
b:
c: 2
d:
- new thing
- bar thing
# - foo thing
The text was updated successfully, but these errors were encountered:
Describe the bug
When appending to array an extra newline is appended before the new element if the last element in the array is commented out at the indentation level where the
-
would be.This does no harm, reporting in case it reflects a parsing bug that is problematic in some other scenario.
version of yq: 3.3.2 (installed w/ Homebrew)
operating system: macOS 10.15.6
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug)
data.yml:
Command
The command you ran:
Actual behavior
Expected behavior
or
Additional context
Compare to when the
#
is in a different position. In all cases the command is the sameand
b: c: 2 d: - new thing - bar thing # - foo thing
and
The text was updated successfully, but these errors were encountered: