-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Indentation with --indent/-I
does not work as expected
#825
Comments
Thanks @tchupp - the indentation is controlled by the underlying go-yaml parser (and has gone through a number of iterations). There are a couple of issues already raised in that project that I think relate to your bug: |
I had a feeling it might have been caused by go-yaml’s behavior. |
Hi! I'm seeing this list indenting even with |
Hey guys, I'm trying to use Yq to replace some values on kubernetes manifest, and I noticed that yq it's not preserving spaces as described on issue description. |
Describe the bug
There is an inconsistency between the actual behavior of
--indent/-I
and the behavior described in this doc: https://mikefarah.gitbook.io/yq/usage/output-format#indentI will provide several example commands, but the expected behavior is also in the docs I linked.
The version of yq: tried with v4.6.1 and v4.9.1
Operating system: mac
Installed via: homebrew
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
sample.yml:
-I0
Command
yq e -I0 '.' sample.yaml
Actual behavior
Expected behavior
Expected to default to 2.
-I1
Command
yq e -I1 '.' sample.yaml
Actual behavior
Expected behavior
Expected to output with 1 indent, lists at the same level as the key.
-I2
Command
yq e -I2 '.' sample.yaml
Actual behavior
Expected behavior
Expected to output with 2 indents, lists at the same level as the key.
-I3
Command
yq e -I3 '.' sample.yaml
Actual behavior
Expected behavior
Expected to output with 3 indents, lists at the same level as the key.
-I4
Command
yq e -I3 '.' sample.yaml
Actual behavior
Expected behavior
Expected to output with 4 indents, list indented 4 from the key.
Please let me know if more detail is required!
Thank you.
The text was updated successfully, but these errors were encountered: