Closed RedWheeler closed 10 months ago
Well, with such an approach we'd have an artificial indentation. Normally I'd say it's not a big problem as the functions are usually not indented much, but considering lambdas are now available, the above approach may lead to the enormous number of extra indentations in random places. Consider code like:
class X:
func foo(
argument_1 : Type,
argument_2 : Type
):
if true:
var lmbda = func(
argument_x : Type,
argument_y : Type
): return 1
as you can see, the arguments of lambda which is on 3rd indentation level are very far to the right already.
Therefore IMO having a minimal indentation is better. It's also consistent with e.g. python's black
module.
Unless there are any other arguments I think we can close this one.
Functions with arguments that are too long to fit on a single line are multi-lined with the same indentation as the function body, making it difficult to differentiate between the function body and definition. Perhaps it would be better to increase the indentation for the arguments to better differentiate the two. For example:
vs