clj-yaml

mmer 2023-08-10T08:45:07.200239Z

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.

borkdude 2023-08-10T09:21:46.149669Z

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

mmer 2023-08-10T09:26:50.716739Z

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.

borkdude 2023-08-10T09:38:37.324539Z

Maybe you can just use string fields as comments then

mmer 2023-08-10T09:39:25.118499Z

This question seems to point at some option in snakeyaml: https://stackoverflow.com/questions/76781250/how-to-use-snakeyaml-setprocesscomments-on-loaderoptions-and-dumperoptions

mmer 2023-08-10T10:18:56.438269Z

Is there any chance of exposing those options?

borkdude 2023-08-10T10:19:22.112979Z

you can just use snakeyaml directly, right

mmer 2023-08-10T10:19:35.094889Z

In bb?

borkdude 2023-08-10T10:22:08.830089Z

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.

borkdude 2023-08-10T10:22:21.306489Z

In bb those snakeyaml things aren't directly exposed

lread 2023-08-10T12:22:49.539179Z

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?

👍 1
lread 2023-08-10T12:23:48.489749Z

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

👍 1
lread 2023-08-10T12:22:58.220329Z

I'll likely also bump internal deps.