Fork me on GitHub
#clj-yaml
<
2023-08-10
>
mmer08:08:07

With clj-yaml is there anyway to retain comments that exist in the file? I am trying to work with a helm chart values file that has loads of useful comments that I want to retain.

borkdude09:08:46

a quick google on snakeyaml + comments leads us here: https://github.com/oyse/yedit/issues/15#issuecomment-224613193 so probably no, in the same manner that an EDN or Clojure s-expression parser does not preserve comments

mmer09:08:50

Thanks. This is where the tension between files being for human and computers is an issue. The comments are really useful to explain to auser what they should be doing.

borkdude09:08:37

Maybe you can just use string fields as comments then

mmer10:08:56

Is there any chance of exposing those options?

borkdude10:08:22

you can just use snakeyaml directly, right

borkdude10:08:08

I guess we could expose some options here: https://github.com/clj-commons/clj-yaml/blob/ab980163accdaf679090dc5ee93e7858e18768f0/src/clojure/clj_yaml/core.clj#L106 Feel free to file an issue + a PR which includes tests.

borkdude10:08:21

In bb those snakeyaml things aren't directly exposed

lread12:08:49

I think we can publish a clj-yaml release, but might as well https://github.com/clj-commons/clj-yaml/issues/104 before doing so, ya?

👍 2
lread12:08:48

was thinking of adding native image tests to CI as well, do you think that would be useful/helpful @U04V15CAJ?

👍 2
lread12:08:58

I'll likely also bump internal deps.