Refactoring and linting tool for Scala
OrganizeImports.removeUnused
& RemoveUnused
(with a known limitation for unused function parameters) are now supported with Scala 3.4.0OrganizeImports.targetDialect
to control wildcard/rename syntax & curly braces stripping behavior (see documentation)LambdaType
and MatchType
are now fully supportedTerm.Interpolate
now always capture curly braces through a wrapping Term.Block
when parsed with scalafix 0.12.x (https://github.com/scalameta/scalameta/issues/3594)
Term.Block
Term.Block
to preserve compatibility with earlier Scalafix versionstree.pos == Position.None
is no longer a reliable way to check whether a given tree
comes from the input document, since trees built via quasiquotes with scalafix 0.12.x may now have positions (https://github.com/scalameta/scalameta/pull/3450)
tree.origin
, ideally combining this check with the previous predicate to preserve compatibility with earlier Scalafix versions-Xsource:3
(https://github.com/scalacenter/scalafix/issues/1949)LambdaType
and MatchType
(#1801) @mrdziubanOrganizeImports
rule on the ExplicitResultTypes
page (#1911) @danichegOrganizeImports
is now a built-in rule (https://github.com/liancheng/scalafix-organize-imports/discussions/215)
com.github.liancheng::organize-imports:0.6.0+37-596459af
has been merged as-is into Scalafix, so OrganizeImports
will keep running without any modification to .scalafix.conf
com.github.liancheng::organize-imports:0.6.0
" warning, simply remove the entry from the scalafixDependencies
setting key (or similar if you are not using sbt)-Wunused:*
flags added in Scala 3.3.0, RemoveUnused
is not yet supported on Scala 3 (see https://github.com/scalacenter/scalafix/pull/1728#issuecomment-1553166913)BasicPositionSuite
changes for a comprehensive view of the changes)Integration tests
documentation. (#1660) @sergey-lagutinScalafix will now issue a warning when loading external rules built with a potentially non-compatible version of Scalafix. Until new versions of these external rules are published, it is therefore expected that you get that warning, for example with OrganizeImports
v0.6.0:
[info] Loading external rule(s) built against an old version of Scalafix (0.9.31).
[info] This might not be a problem, but in case you run into unexpected behavior, you
[info] should try a more recent version of the rules(s) if available. If that does
[info] not help, request the rule(s) maintainer to build against Scalafix 0.10.0-RC1
[info] or later, and downgrade Scalafix to 0.9.x (x>=31) for the time being.
Note that most community rules (including OrganizeImports
) will work just fine despite this warning as the breaking changes in 0.10.x are very limited.
metaconfig-pprint
to limit the impact of a breaking change in com.lihaoyi::pprint:0.7.0
(see https://github.com/com-lihaoyi/PPrint/pull/72 & https://github.com/scalameta/metaconfig/pull/154). External rules had no reason to directly use the PPrint classes, but the internal usage of PPrint in metaconfig's derive*
macros (used for the configuration case classes) means that a recompilation is needed.
scalafix-cli:0.10.x
brings com.lihaoyi::pprint:0.6.6
so that configurable rules compiled against scalafix-core:0.9.x
can runscalafix-core:0.10.x
will cause cryptic runtime failures with scalafix-cli:0.9.x
, so you should reflect that by releasing your rule built against scalafix-core:0.10.x
with a major bump, and ideally by adding documentation describing your compatibility matrix.ExplicitResultTypes
: backquote types when needed (#1578) @danichegCONTRIBUTING.md
(#1584) @danichegWhen loading external rules, Scalafix now verifies whether conditions are held to guarantee compatibility. It will therefore prevent rules built with a future version of Scalafix to be loaded, and issue a warning when rules built with an older, potentially non-compatible version of Scalafix are loaded.
The latter means that you will see a warning when loading any external rule available as of today, for example with OrganizeImports
v0.6.0:
[info] Loading external rule(s) built against an old version of Scalafix (0.9.31).
[info] This might not be a problem, but in case you run into unexpected behavior, you
[info] should try a more recent version of the rules(s) if available. If that does
[info] not help, request the rule(s) maintainer to build against Scalafix 0.10.0-RC1
[info] or later, and downgrade Scalafix to 0.9.x (x>=31) for the time being.
Note that most community rules (including OrganizeImports
) will work just fine despite this warning as the breaking changes in 0.10.x are very limited.
metaconfig-pprint
to limit the impact of a breaking change in com.lihaoyi::pprint:0.7.0
(see https://github.com/com-lihaoyi/PPrint/pull/72 & https://github.com/scalameta/metaconfig/pull/154). External rules had no reason to directly use the PPrint classes, but internal usage of PPrint in metaconfig's derive*
macros (used for the configuration case classes) means that a recompilation is needed.
scalafix-cli:0.10.x
brings com.lihaoyi::pprint:0.6.6
so that configurable rules compiled against scalafix-core:0.9.x
can runscalafix-core:0.10.x
will cause cryptic runtime failures with scalafix-cli:0.9.x
, so you should reflect that with a major bump when releasing your rule built against scalafix-core:0.10.x
, and ideally a message describing your compatibility matrix.CONTRIBUTING.md
(#1584) @danicheg