v2.6.0
Major changes
This release is generally dedicated to non-Scala features.
Scaladoc and comments
We are introducing scaladoc and comment formatting changes in this version. Please see
https://scalameta.org/scalafmt/docs/configuration.html#docstrings and
https://scalameta.org/scalafmt/docs/configuration.html#comment-processing
Some related pull requests:
- Scaladoc: support table formatting in FormatWriter (#2006) @kitbellew
- (#1387 #1887) FormatWriter: format multiline docstrings (#1987) @kitbellew
- (#891) Docstrings: rename styles, clean up text after
*
(#1982) @kitbellew - (#1234) FormatWriter: implement wrapping of long comments (#1970) @kitbellew
- (#1403) FormatWriter: allow folding scaladoc to one line (#1965) @kitbellew
Scala embedded in XML
To modify formatting of scala code within XML, see https://scalameta.org/scalafmt/docs/configuration.html#xmlliteralsassumeformatted
- (#1882) Router: allow relative formatting of spliced XML (#2021) @kitbellew
Line overflow
If it's desirable to avoid breaking some very long lines if they will exceed the maxColumn
limit even with a newline, see https://scalameta.org/scalafmt/docs/configuration.html#newlinesavoidforsimpleoverflow
- (#1505) State: don't penalize strings that always overflow (#2024) @kitbellew
CLI
When running the scalafmt
command-line tool, if one specified any Scala files explicitly, they would be formatted regardless of project filters specified in .scalafmt.conf
.
Here, we introduce a new CLI option --respect-project-filters
to modify this behaviour.
- (#1964) ScalafmtRunner: respect filters with custom files (#2020) @kitbellew
Other features
- (#1989) #1627 [23]: Router: source=keep try keep NL/noNL in apply(... (#2000) @kitbellew
- Router: allow folded
extends
if ctor is folded (#1980) @kitbellew - (#1973) FormatOps: for source=fold, compact extends/with (#1979) @kitbellew
Idempotence fixes
- (#1799) Router: penalize NL on breakChainOnFirstMethodDot (#2016) @kitbellew
- (#1802 #1803 #1804) Router: idempotence of breakChainOnFirstMethodDot (#2010) @kitbellew
- (#1798 #1801) Router: merge config-style rule into others (#2008) @kitbellew
- FormatOps bugfix: get TParams correctly, not the Paramss (#2007) @kitbellew
Bug fixes
- TokenOps: look for "format: off" in any comment (#2017) @kitbellew
- (#1400) Split: represent a newline alternative differently (#2011) @kitbellew
- (#2012) RedundantBraces: don't rewrite nested Defn (#2015) @kitbellew
- FormatWriter bugfix: handle asterisks in docstring (#2014) @kitbellew
- (#1640) State: fix column positions for multiline strings (#2009) @kitbellew
- (#1998) FormatWriter bugfix: align strip margin in
s"""|
(#2001) @kitbellew - FormatWriter bugfix: comment with empty first line (#1990) @kitbellew
- (#1969) FormatOps: fix finding
=>
in lambda without args (#1983) @kitbellew - FormatWriter bugfix: comment format on lookaround (#1968) @kitbellew
Dependency updates
- Update sbt-native-packager to 1.7.2 (#1992) @scala-steward
- Update sbt-scalajs to 1.1.0 (#1994) @scala-steward
- Update scalatest to 3.1.2 (#1997) @scala-steward
- Update sbt-mdoc to 2.2.0 (#1995) @scala-steward
- Update scalatags to 0.9.1 (#1991) @scala-steward
- Dependency: upgrade scalameta to 4.3.13 (#1986) @kitbellew
- sbt plugin update (#1971) @poslegm