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
Describe the bug
yq doesnt count the first line if it's a comment. I want to get the line number of a specific value in a file. If the first line is a comment, yq doesnt count the line.
By default yq pre-processes header comments - this was a bit of a annoying workaround added to fix a number of issues with the underlying go-yaml parser :/
However, that workaround has some unwanted side effects, this being one of them. You can disable the header processing by adding the flag --header-preprocess=false - then you'll get what you expect.
Describe the bug
yq doesnt count the first line if it's a comment. I want to get the line number of a specific value in a file. If the first line is a comment, yq doesnt count the line.
yq e '.lalilu | line' test123.yml
-->4
(instead of 5)If i change the first line to a regular value everthing works fine:
yq e '.lalilu | line' test123.yml
-->6
Version of yq: 4.27.5
Operating system: linux and windows (tested on both)
Installed via: binary release and choco
maybe related to: #1181
The text was updated successfully, but these errors were encountered: