grain icon indicating copy to clipboard operation
grain copied to clipboard

Grainfmt: Indent binops when wrapping

Open ospencer opened this issue 1 year ago • 0 comments

Right now if you format foo && bar && baz (imagine those are all long things that cause wrapping) you get

foo &&
bar &&
baz

but if would be nice if this formatted to

foo &&
  bar &&
  baz

for reading clarity.

In particular when I see something like assert foo == bar get formatted to

assert foo ==
bar

I find it a little hard to read vs

assert foo ==
  bar

However, this should not happen in places like if conditions:

if (
  foo &&
  bar &&
  baz
) ...

ospencer avatar Jul 31 '22 15:07 ospencer