14 years into Scala, I'm experimenting with a new way of formatting my code. I've started column-aligning each opening `(` of explicit/implicit parameter block, and the `:` of the return type in method/class definitions, with a four-space indent for long lines. Liking it so far.
-
-
Forget it. Vertically aligning on a random column



-
Yeah, that took me about a decade too. Scalafmt persuaded me it was acceptable...
- Show replies
New conversation -
-
-
How did you format the implicit group before if it didn't fit in a single line?
-
I always felt like the closing `)` of the preceding block and the opening `(` of the implict block should have zero whitespace between them. So I'd start by putting the entire signature on one line, and then just split on whitespace, fitting as much on each line as possible.
End of conversation
New conversation -
-
-
My preferred formatting (which is enforced by our current scalafmt config) looks like this. I think the return type could probably be formatted better in this case but otherwise I like it. I have a strong personal preference for short lines
pic.twitter.com/abjoM7YKdk
-
Both are nice, and I’d be happy with either so long as it’s applied consistently throughout the entire codebase.
End of conversation
New conversation -
-
-
This is pretty similar to ours, except not quite so horizontally spread out. If you first wrapped the parameters at the opening '(', indented 4 spaces, it's almost identical.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I like that but Scalafmt doesn't support this formatting in multi curied parameters :(
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This Tweet is unavailable.
-
It's Mitigation, a monad which aggregates error types. Not ready yet, but code is at: http://github.com/propensive/mitigation …
End of conversation
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.