Stream: compiler development

Topic: fmt `{...}` header with multiple fields


view this post on Zulip Anton (Aug 03 2026 at 18:26):

Currently we roc fmt forces this into a single line:

app [main!] {
    pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/1.0.0/AnZoxzoGPtSGQ15EQh6pBeeaHJ7aizP9MQhK81dES3Uq.tar.zst",
    roc: "nightly-2026-August-03-94cbed3"
}

So after fmt, roc: "nightly... is put on the same line as pf and is invisible in a typical editor. Do we want the rule to be that if there are multiple fields between the {...} that it is forced to be multiline or only that it is kept multiline if it was multiline to begin with?

view this post on Zulip JRI98 (Aug 03 2026 at 19:09):

I don't know if it still applies everywhere, but I remember that in the past it followed the Zig convention of being multiline when it has a trailing comma.
In this case, the fix would be to do this:

app [main!] {
    pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/1.0.0/AnZoxzoGPtSGQ15EQh6pBeeaHJ7aizP9MQhK81dES3Uq.tar.zst",
    roc: "nightly-2026-August-03-94cbed3",
}

view this post on Zulip Anton (Aug 04 2026 at 11:38):

Thanks @JRI98, I forgot about that


Last updated: Aug 12 2026 at 12:35 UTC