Skip to content

What is the concept behind the different kind of comments? #1238

Answered by mikefarah
towi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi - thanks for your feedback! I'm a little limited to my time atm, so I'll have to keep this short - I appreciate your detail though.

headComment / lineComment / footComment are parsed directly from the underlying yaml parser (go-yaml). They should represent exactly that according to their node - however go-yaml just makes a best effort and it's not 100% accurate unfortunately :(

I dont have a built in AST representation visible, however you can get similar data by using an expression like:

yq '... | {"path": path, "headComment": headComment, "lineComment": lineComment, "footComment": footComment}'

I don't have yq available on the terminal I'm on - so hopefully I haven't made a typo.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikefarah
Comment options

Answer selected by towi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants