v3.0.0
Scala 3
This release is first and foremost about Scala 3 support. This complex project took the better of the year and is the brainchild of @tgodzik, with substantial contributions on the parser end from @dos65 , @michalbednarz and @kpbochenek .
How to use:
- set the dialect
- optionally enable significant indentation
- optionally enable some rewrite rules
Configurable indentation
We have added a number of options to control indentation.
Scaladoc and markdown
We have added support for fenced code blocks in scaladoc (within .scala
files) and also markdown (.md
) files. The scala embedded within those fenced blocks will be formatted.
Additionally, one can set a different line size for wrapping scaladoc.
Blanks around top-level statements
- configurable number of blanks around top-level statements
- configurable blanks within top-level statements (around the body)
Import rewrites
We have introduced a new imports rewrite rule, which replaced and expanded upon all existing rules.
Binpacking
While binpacking is still highly experimental, we have made improvements to the algorithm to avoid blowing up due to a high number of options to consider.
Also, a new Oneline
option for binpacking is available to binpack only parameters/arguments which fit on a single line. The result is more readable and also faster to format.
Newlines before open parens in definitions or calls
Normally, we'd add line breaks after an opening parenthesis in a method definition or method call, both using default formatting and the so-called vertical multiline.
Now we have added support for formatting method definitions (and, for scala 3 only, method calls) by
breaking before the opening parenthesis.
Additional controls for line breaks
- type bounds
- multi-line assignment
- overflow for single-line comments
- select chains
- dangling parens in tuples