Open
Description
This code is formatted with jsonnet fmt:
local stringToInt(s) =
local zeroCodepoint = std.codepoint("0"),
stringToIntHelper(s, idx, acc) =
if idx == std.length(s) then // see what happened here?
acc
else
local digit = std.codepoint(s[idx]) - zeroCodepoint;
stringToIntHelper(s, idx + 1, acc * 10 + digit);
stringToIntHelper(s, 0, 0);
stringToInt("42")
A simpler artificial example:
local xxxxxxxxxxxxxxxxxxxx = 42,
yyyyyyy =
{
something_long: 42,
};
true
So if there are multiple binds in a local, and one of them has a body starting on a new line, that body gets weirdly dedented.