Releases: scalacenter/scalafix
Scalafix 0.3.1
- Fixed a bug in organize imports when there was no import in the original source file.
- Patch.apply and OrganizeImports no longer accept a redundant
tree: Tree
argument, thectx
already contains the tree. - Xor2Either is disabled by default now, it was enabled by default causing the
scalafix
command to slow down significantly. Rules usingscala.meta.Mirror
should not experience a slowdown. - Added new
Rename(from: Name, to: Name)
tree patch that's accesible via the scalafix-library.
Scalafix 0.3.0
-
Scalafix now uses the scala.meta semantic API! See scala.meta 1.6 release notes for more details about the semantic api. This first release of the scala.meta semantic API enables rules to query for the "symbol" of a name that appears in a Scala source file. A symbol is a unique identifier of a definition such as a class, val, def or trait.
-
To demonstrate the capabilities of rules using the scala.meta semantic API, we have included an example rule called Xor2Either. The rule migrates usage of
cats.data.Xor
toscala.util.Either
. -
Rules can now be implemented in terms of "tree patches", which are high level descriptions of common refactoring operations. Tree patches can be composed to build more advanced refactorings such as
Xor2Either
. The current available tree patches areReplace
: Replaces usage of a symbol with another name.AddGlobalImport
: Adds a top-level import to source file.RemoveGlobalImport
: Removes a top-level import from source file.
Special thanks go to @ShaneDelmore for helping out try the scalafix patch API at every step of its development. His feedback has been invaluable in improving the design of the API.
-
Configuration in .scalafix.conf has been greatly improved to support a wide range of options. Examples, see patches,
imports
(now removed) andAll options
(removed).
Scalafix 0.2.1
sbt scalafix
runsExplicitImplicit
andProcedureSyntax
by default when there is no.scalafix.conf
.- Upgraded scala.meta dependency to fix parsing + pretty-printer bugs.
Scalafix 0.2.0
- First semantic rule! See ExplicitReturnTypes.
- Removed command line interface in favor of compiler plugin. Why? To run semantic rules, scalafix needs to compile source files. The scalafix command line tool has no aspiration to become a build tool.
Scalafix 0.1.0
- New command line tool:
scalafix
. (EDIT: superseded by scalafix-nsc compiler plugin in v0.2) - New SBT plugin:
sbt-scalafix
. See sbt-scalafix. - Two new rules: ProcedureSyntax and
DottyVolatileLazyVal
.