tweag / topiary

https://topiary.tweag.io/
MIT License
579 stars 29 forks source link

Update formatting of function application and parenthesized blocks in Nickel #732

Closed yannham closed 2 months ago

yannham commented 2 months ago

Apply the new formatting proposal detailed in https://github.com/tweag/nickel/issues/2003 for function application and parenthesized expressions in Nickel, to reduce the inflation of indentation when using higher-order functions (and more specifically contract constructors such as std.contract.from_predicate or std.contract.custom).

This PR required to change a bit the logic of the rules applying to function applications and the like. I was helped by @nbacquey through a pairing session; thanks again for your help!

Version update

This commit also bumps the patch version of the workspace to prepare for the corresponding release of topiary-queries so that it can be published and use from the nickel-* crates.

Tests

In addition to regression tests, this PR also updates the Nickel stdlib sample to the latest version, because the new formatting rules are more relevant to the latest additions. The result has been reviewed and diffed and the expected sample has been updated accordingly.

Checklist

Checklist before merging: