Open Zebradil opened 1 year ago
This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.
Nah, not stale.
@Zebradil Sorry for the delay in response. This seems to be a bug and we are able to reproduce this. We would like to know if this is blocking your use of ytt and also understand more about your use case. Are you using ytt fmt to get the output well formatted?
Hey @vmunishwar, no worries. I'll provide more context.
I have a workflow in which I want to format yaml files in a consistent way. I was using yq
for that but noticed that there is ytt fmt
, which would've been a good opportunity to eliminate yq
in my workflow (it is not used for anything else). It's a pity that ytt fmt
didn't work, so I decided to contribute to the project with this bug report :-)
However, this is not blocking me. In golang code, I format yaml files with the yaml package and outside I still use yq
.
I've run into this same issue. This seems like it renders ytt fmt
basically unusable, unless I happen to know that none of the yaml files I'm going to process with it contain empty objects, or empty arrays, or perhaps other things that trigger this bug.
What good is a code formatting tool that changes the meaning of your code?
will check this issue this week.
What steps did you take:
What happened:
Notice how the empty map is replaced by
another top-level element
, which becomes a list element oftop-level list with empty map
.What did you expect:
The output yaml is structurally identical to the input yaml.
Environment:
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
π "I would like to see this addressed as soon as possible" π "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.