yq
yq copied to clipboard
Parser doesn't propery identify failing line
I had a gigantic compose.yaml file that didn't work. jq didn't properly identify the failing line, but YAMLLint did.
I have cleaned up my compose.yaml with a smaller reproducing case.
alpha:
beta:
gamma:
"this is really the faulty line:foo"
- "this is an okay line:oh yeah!!"
When I run yq it complains about line 2.
% yq compose.yaml
Error: bad file 'compose.yaml': yaml: line 2: did not find expected key
YAMLlint complains on line 5, it's one line off but it really helped me pinpoint the error when the file was hundreds of lines long. My original file had many entries on "gamma"-level.
https://www.yamllint.com/