Fork me on GitHub
#clj-yaml
<
2022-09-20
>
lread13:09:20

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).

borkdude13:09:24

why do you say unlikely?

lread13:09:11

Just a hunch

borkdude13:09:27

I think Andrey himself hinted at this possibility

borkdude13:09:35

to have a custom resolver to do anything you want

borkdude13:09:43

in the bitbucket issue

lread13:09:59

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

lread13:09:57

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

borkdude13:09:06

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?

borkdude13:09:40

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

lread13:09:32

Yeah we are on the same page there.

👍 1
borkdude16:09:01

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

grzm18:09:25

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.

grzm18:09:16

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

lread19:09:42

Have fun at StrangeLoop @grzm!

borkdude20:09:42

@grzm I understand and have fun!

grzm20:09:21

(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?)

borkdude16:09:21

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

lread17:09:03

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

lread17:09:04

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.

lread17:09:21

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

lread19:09:20

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

lread20:09:44

Much better reaction than my wife had!

lread20:09:33

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.

borkdude20:09:04

@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

borkdude20:09:31

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

lread20:09:36

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.

borkdude20:09:39

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

borkdude20:09:53

or bitbucket fork, if you're so inclined

lread20:09:04

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.

lread20:09:35

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

grzm23:09:20

Sweet PR! Me likey!

❤️ 2
grzm02:09:41

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