4 ms·
Looks nice! Is there something similar for yq?
by ingoaf 3y ago
Looks nice! Is there something similar for yq?
- jrockway 3y agoyaml2json | jq ...
- seanp2k2 3y agoThis. The number of times I’ve had to mess with or write yaml and gotten some ridiculously unhelpful error because I forgot a space somewhere or needed dashes in my sub-whatever are equal to the number of times I’ve had to write yaml. I’d seriously rather work with XML than YAML. It’s worse to read and 10x worse to write than JSON for anything nontrivial. It’s the TAI64 of serialization. It’s like JSON that you have to type the spaces out to format visually yourself for each thing. I don’t understand the mindset of folks who prefer it. Quotes in yaml are as much fun as they were with mysql_real_escape_string. The only way I work with any significant amount of YAML is by converting it to json. Terrible format, 0/10, let’s just write everything in acme::Bleach since significant whitespace is so darn cool right?
- commotionfever 3y agoI agree. I made a tool for this which can do x2y where x or y can be any of json, yaml, toml, ini, xml, html, csv, tsv it's great for converting nearly any format to json for querying or transforming with jq https://github.com/sentriz/rsl/ https://github.com/sentriz/rsl/
- mdaniel 3y agoI'm aware that yq has a lot more editing features, so it's not apples-to-apples, but I'll also draw ones attention to gojq's --yaml-input flag <https://github.com/itchyny/gojq/blob/v0.12.13/README.md?plain=1#L83 https://github.com/itchyny/gojq/blob/v0.12.13/README.md?plai...> (they have yaml out, also, but I use that a lot less often) allowing leveraging the same language for both input formats