-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove pretty-printing #202
Conversation
This CID has not been verified - dag-json w/ sha2-512 capped at 4 bytes for a block that's non-trivial to reconstruct manually.
@@ -318,7 +318,7 @@ func TestFocusedTransformWithLinks(t *testing.T) { | |||
Wish(t, progress.Path.String(), ShouldEqual, "linkedMap/nested/nonlink") | |||
Wish(t, must.String(prev), ShouldEqual, "zoo") | |||
Wish(t, progress.LastBlock.Path.String(), ShouldEqual, "linkedMap") | |||
Wish(t, progress.LastBlock.Link.String(), ShouldEqual, "baguqeeyevmbz3ga") | |||
Wish(t, progress.LastBlock.Link.String(), ShouldEqual, "baguqeeye2opztzy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty uncomfortable about changing this without verifying the block encodes to this CID, but the fixture is complicated enough that I'm not keen to reconstruct it for a one-off verification unless this arises out of some previously constructed fixture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I've wanted this for some time.
You could also simplify the bindnode examples, which explicitly set refmt parameters to disable pretty-printing: https://pkg.go.dev/github.com/ipld/go-ipld-prime@master/node/bindnode#example-Prototype-OnlySchema
I think those could now use the default behavior.
@rvagg LGTM, looks amazing 💌 |
As far as I can tell, using refmt explicitly is only to supply non-default options, which only matters for the encoding pretty-printing. So I'm pretty sure it's a no-op to remove empty refmt options from decodes. And for the encodes you're changing the default to not pretty-print, so that also looks like a no-op change to me. |
👍 to seeing less of refmt -- I'm wholeheartedly in favor of change in that direction. Most (all?) of the places it appears were punts where I didn't have a better plan at the time. If we do get into working on configurability patterns for ipld codecs, I'd like to not have any refmt symbols appear in them. There's just no reason to have codec configurability cause the user's attention to get stretched out across repos if we can help it. |
but .. this is only part of the story, because we still have map key ordering "problems"