yq
yq copied to clipboard
--indent 0 results in 4 spaces instead
Describe the bug
Using --indent flag with anything less than or equal to zero results in 4 spaces being used instead.
Version of yq: 4.33.3 Operating system: linux Installed via: pacman, but also reproducible with locally built binary
Input Yaml
data1.yml:
list:
- foo
Command
yq --indent 0 -i '.list[0] = "bar"' data1.yaml
Actual behavior
list:
- bar
Expected behavior
list:
- bar
Additional context
This isn't limited to the -i (inplace) flag.
Yeah this is what the underlying yaml library does - I believe there is already a bug raised against it - but that library isn't getting much love atm.
I plan on switching to another yaml library hopefully sometime this year. It will be a reasonably big job though :/
Oh, I just found your issue https://github.com/mikefarah/yq/issues/825. What library would fix this?