Open davidanthoff opened 2 years ago
btw with an indent of 4 rule then
@map({
name = _[2]["name"],
uuid = UUID(_[1]),
path = _[2]["path"]
}) |>
@mutate(
versions = (Pkg.TOML.parsefile(joinpath(registry_folder_path, _.path, "Versions.toml")) |>
@map(i->{version=VersionNumber(i[1]), treehash=i[2]["git-tree-sha1"]}) |>
@orderby_descending(i->i.version) |>
@take(max_versions) |>
collect)
) |>
collect
would be
@map({
name = _[2]["name"],
uuid = UUID(_[1]),
path = _[2]["path"]
}) |>
@mutate(
versions = (Pkg.TOML.parsefile(joinpath(registry_folder_path, _.path, "Versions.toml")) |>
@map(i->{version=VersionNumber(i[1]), treehash=i[2]["git-tree-sha1"]}) |>
@orderby_descending(i->i.version) |>
@take(max_versions) |>
collect)
) |>
collect
is that really what we want? IMO when it lines up it's a bit more pleasant.
it would also apply generally to all binary ops
a +
b
would be
a +
b
which is why for these operations in the other styles we don't abide strictly to the "indent of x" rule.
Yeah, I think that would still make sense in a strictly indent based story, right? CC @pfitzseb
I think it should in the end look like this:
@map({
name = _[2]["name"],
uuid = UUID(_[1]),
path = _[2]["path"]
}) |>
@mutate(
versions = (Pkg.TOML.parsefile(joinpath(registry_folder_path, _.path, "Versions.toml")) |>
@map(i->{version=VersionNumber(i[1]), treehash=i[2]["git-tree-sha1"]}) |>
@orderby_descending(i->i.version) |>
@take(max_versions) |>
collect)
) |>
collect
Here is an example where the formatter seems to fall back on aligning things. It turns
into
which it shouldn't do.