-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yaml top document separator removed #879
Comments
Yep - this is a known formatting issue with the underlying go-yaml parser. Note that this only affects the readability of the document |
and raise an error with yamlint |
Oh that's interesting - I'm not aware of it being recommended in the yaml spec shrug. It might be worth raising the issue in go-yaml. |
A kind of an ugly workaround, if you really need it: $ cat sample.yml
---
type: shelter
pets:
- a: cat
- b: dog
$ yq e '.' sample.yml
type: shelter
pets:
- a: cat
- b: dog
$ yq e '["---",.][]' sample.yml
---
type: shelter
pets:
- a: cat
- b: dog |
Well that's unexpected...I'm not sure how that works! Gotta look into that. |
Oh I see now - nice trick |
I'm going to fix this up in the next release |
I've put a fix in |
Describe the bug
When editing Yaml files with
---
at its top, those hyphens are removedVersion of yq: 4.9.6
Operating system: linux
Installed via: docker
Command
Actual behavior
Expected behavior
The text was updated successfully, but these errors were encountered: