clj-yaml

lread 2022-09-20T13:09:20.799479Z

I think I'll dig into understanding the change in snakeyaml that caused '083' to become 083. This might give me some notion of new ways to override the behaviour in clj-yaml (unlikely) or a write a PR to snakeyaml to undo it which might be considered by Andrey (possible).

borkdude 2022-09-20T13:15:24.980399Z

why do you say unlikely?

lread 2022-09-20T13:17:11.335679Z

Just a hunch

borkdude 2022-09-20T13:17:27.042749Z

I think Andrey himself hinted at this possibility

borkdude 2022-09-20T13:17:35.399319Z

to have a custom resolver to do anything you want

borkdude 2022-09-20T13:17:43.793069Z

in the bitbucket issue

lread 2022-09-20T13:17:59.091849Z

Oh that's a known technique. I'm looking for something new.

lread 2022-09-20T13:18:57.401679Z

I'll play around but I think the custom resolver technique will turn off recognizing octals.

borkdude 2022-09-20T13:20:06.488149Z

I think grzm was mostly interested in what gets emitted (not what is parsed): quoted numbers should stay quoted. Is that what you're also referring to?

borkdude 2022-09-20T13:20:40.822399Z

Doing this is still within the yaml 1.1 spec and will unbreak clojure users of clj-yaml

lread 2022-09-20T13:21:32.890649Z

Yeah we are on the same page there.

👍 1
borkdude 2022-09-20T16:00:01.802169Z

Btw, @grzm - are you interested in becoming a maintainer too?

grzm 2022-09-20T18:23:25.872709Z

Thank you for considering me worthy of maintainer-hood. I respectfully decline. I’m moving to JSON to avoid the octal case, so that piece won’t be immediately bothering me; so the only other thing I’m looking for is some way to handle unknown tags. I’m interested in contributing to solutions for both of those, however: I just can’t add another ongoing commitment right now.

grzm 2022-09-20T18:24:16.788929Z

(and re: the passthrough/unknown-tags thing: I’m headed to StrangeLoop so will be out of this loop for the next week 😕)

lread 2022-09-20T19:29:42.829989Z

Have fun at StrangeLoop @grzm!

borkdude 2022-09-20T20:19:42.079639Z

@grzm I understand and have fun!

grzm 2022-09-20T20:23:21.389619Z

(I mean, I'd hate to be like that awyeah-api maintainer: takes months to get to simple tickets and is behind the upstream aws-api library. Who does that?)

grzm 2022-09-20T20:23:33.107919Z

Thanks, @lee, @borkdude!

borkdude 2022-09-20T16:00:21.205639Z

I'd love you to join our cozy clj-yaml team :)

lread 2022-09-20T17:06:03.889299Z

Good… I can feel your anger. Yes.. yes.. join the dark side…

lread 2022-09-20T17:10:04.379729Z

So I think I see what happened in snakeyaml. There was a bug that misinterpreted 083 as a float. And since a float is not a default scalar (string), it felt it needed to to quote it to preserve its string-ness by emitting it as '083'. It now correctly interprets 083 as a string. And strings are not typically emitted with quotes. Soo… we get 083 output.

lread 2022-09-20T17:12:21.102029Z

Now, I’ll see what we can do about that.

lread 2022-09-20T19:28:20.715819Z

Odd thing, I was explaining the above to my wife, and she feigned disinterest. Imagine!

borkdude 2022-09-20T20:20:08.975899Z

@lee Aha :)

lread 2022-09-20T20:20:44.554139Z

Much better reaction than my wife had!

lread 2022-09-20T20:24:33.114759Z

I’m not sure the custom Resolver approach will help here. 083 should still resolve to a string, we just want to emit that string wrapped in quotes. I’m going to raise an issue at snakeyaml to propose that strings that look like numbers always be wrapped in quotes (and follow up with PR if Andrey is agreeable to the idea). This already happens for certain strings like ones that start or end with a space.

borkdude 2022-09-20T20:27:04.597889Z

@lee thanks! I think he is more keen to react to issues that already have a patch than to discuss with a lot of words and admit this needs a patch. my hunch

borkdude 2022-09-20T20:27:31.569609Z

I think that because of his latest reactions in the bitbucket issue

lread 2022-09-20T20:29:36.050869Z

Yeah maybe. I’ll do my regular thing and raise the issue first with the offer of a PR. And maybe follow up with a PR before waiting for discussion.

borkdude 2022-09-20T20:30:39.354449Z

Or you could link to a proposed patch in your github fork or so

borkdude 2022-09-20T20:30:53.064859Z

or bitbucket fork, if you're so inclined

lread 2022-09-20T20:32:04.549029Z

Oh… yeah, I suppose, kinda backward for my brain. Issue helps me to think but could write that privately and blarp it all out at once.

lread 2022-09-20T20:32:35.296929Z

Yeah, ok, I think your hunch is a good one.

lread 2022-09-20T22:55:39.508339Z

Okey dokey, here’s my first stab at a PR: https://bitbucket.org/snakeyaml/snakeyaml/pull-requests/30/always-emit-numberish-strings-with-quotes

grzm 2022-09-20T23:40:20.638459Z

Sweet PR! Me likey!

❤️ 2
grzm 2022-09-21T02:49:41.096569Z

But does Andrey likey? That is the question. De gustibus non est disputandum.