Skip to content

Releases: scalacenter/scalafix

Scalafix v0.5.8

26 Jan 16:22
2ab78c5
Compare
Choose a tag to compare

Scalafix v0.5.7

07 Dec 16:56
1e59d79
Compare
Choose a tag to compare
  • #472 Add --diff to only report linter messages from a git diff. Useful to enable Scalafix into an existing codebase. For more details, see --diff and --diff-base in --help .

Example usage, find all vars that are introduced since scalafix v0.5.6

$ scalafix -r DisableSyntax --config-str="DisableSyntax.keywords=[var]" --diff-base=v0.5.6
scalafix-tests/unit/src/test/scala/scalafix/tests/cli/CliGitDiffTests.scala:224:13: error: [DisableSyntax.keywords.var] keywords.var is disabled
    private var revision = 0
            ^
scalafix-core/shared/src/main/scala/scalafix/internal/util/IntervalSet.scala:31:11: error: [DisableSyntax.keywords.var] keywords.var is disabled
          var i = start
          ^

Scalafix v0.5.6

25 Nov 09:04
24fdac3
Compare
Choose a tag to compare

First of all, I am excited to welcome @MasseGuillaume to the Scalafix team! Moreover, I'm also thrilled to see @fommil joining the effort by sponsoring @vovapolu to work on improving scalafix for functional programming, see #451. Consider pitching in too!

Features

Documentation

  • #418 Add detailed documentation comparing scalafix with alternative tools
    like Scala Refactoring, WartRemover, ScalaStyle and IntelliJ Scala plugin, by @olafurpg
  • #419 Simplify installation of sbt-scalafix with scalafixEnable command that can
    automatically setup all the correct scala compiler settings from an sbt shell session, regardless of
    existing settings in build.sbt. Previously, it was necessary to manually
    update build.sbt with fairly tricky corner cases, by @olafurpg
  • #420 New section in the docs for using scalafix with Maven builds, https://scalacenter.github.io/scalafix/docs/users/installation#maven by @fanf

Internal

  • #454 refactor the scalafix build for easier cross-building and cross-publishing, by @MasseGuillaume. Please note that there are no published artifacts for v0.5.4 and v0.5.5 due to the build misconfiguration that got fixed by this PR.

Scalafix v0.5.5

23 Nov 10:16
081592b
Compare
Choose a tag to compare

(redacted) There are no published artifacts for this release. Please use v0.5.6 https://github.com/scalacenter/scalafix/releases/tag/v0.5.6

Scalafix v0.5.4

21 Nov 13:12
c28a30d
Compare
Choose a tag to compare

(redacted) There are no published artifacts for this release. Please use v0.5.6 https://github.com/scalacenter/scalafix/releases/tag/v0.5.6

Scalafix v0.5.3

11 Oct 14:43
Compare
Choose a tag to compare

Bug fixes

Features and improvements

Check out our new website https://scalacenter.github.io/scalafix/

Every page has an "Edit this page" link at the top right, please send us PRs to improve the content.

scalafix

Scalafix v0.5.2

11 Oct 14:42
Compare
Choose a tag to compare
  • #367 RemoveUnusedTerms rule for removing unused local var and val, by @DanielaSfregola
  • #375 Cross-build sbt-scalafix for sbt 0.13 and 1.0, by @gabro. Note that scalafix-sbt is still not released for sbt 1.0, however.

Scalafix v0.5.1

21 Sep 22:50
Compare
Choose a tag to compare
  • #359 Fixes #369 which triggered rule to be run twice, by @xeno-by
  • #371 Upgrade to scalameta 2.0.1, which most importantly fixes #362 (NullPointerException in console)

Scalafix v0.5.0

18 Sep 15:46
Compare
Choose a tag to compare

Thank you everyone who contributed!

Scalafix v0.5.0-RC3

11 Sep 15:23
Compare
Choose a tag to compare

New features for end-users

This release introduces major improvements to sbt-scalafix, scalafix-cli.

New features for rule authors

  • Ability to implement rules for sources of sbt builds, including *.sbt files. The API to write sbt rules is identical to regular Scala rules.
  • Rules can now emit lint messages with ctx.lint, see LintMessage.
  • Thanks to upstream improvements in the Scalameta v2.0 Semantic API, it is now possible to
    • query symbols of implicit arguments, implicit conversions, type parameters, .apply/.unapply and symbol signatures. This represents significant portion of the work for Scalafix v0.5 and is a major milestone for the Scalameta semantic API.
    • parse symbols signatures as scala.meta.Type, including the new Type.Method which is the "type of methods" and cannot be written in source.
  • Rule.init(config): Configured[Rule] allows rules to load the user configuration during rule construction. Before, rules had to parse the configuration while fixing each individual file.
  • PatchOps.replaceSymbol/replaceTree, see Patch.
  • PatchOps now has docstrings!
  • Rules can have multiple names with optional deprecation warnings.

Bug fixes / Improvements

  • ExplicitResultTypes produces valid type signatures in a lot more cases than before. Note that it still has some known bugs, see #324.
  • More robust classloading to invoke scalafix in sbt-scalafix. Previously, sbt-scalafix used synthetic projects which cause problem in some multi-module builds. Now, sbt-scalafix uses Coursier instead.
  • Improved dynamic compilation of custom rules while running from multi-module sbt builds.
  • Extension methods now resolve to the correct symbol. For example, head in Array[Int].head previously resolved to Predef.intArrayOps and now it resolves to IndexedSeqOptimized.head.
  • scalafix-cli automatically infers whether passed --rewrites are semantic or syntactic. This means it's possible to run custom syntactic rules from scalafix-cli without passing in --classpath.

Breaking changes

From 0.5 onwards, our CI will check binary breaking changes in the public API on every pull request. Note that modules inside the package scalafix.internal don't promise binary compatibility between any releases, including PATCH upgrades.

  • github: rewrites should be inside the scalafix/rules/... directory instead of scalafix/rewrites/... directory

  • scalafix.Rewrite/SemanticRewrite is now deprecated and Mirror is now SemanticdbIndex.

    // before
    case class MyRewrite(mirror: Mirror) extends SemanticRewrite(mirror) {
      def rewrite(ctx: RewriteCtx): Patch
    }
    // before
    case class MyRule(index: SemanticdbIndex) extends SemanticRule(index) {
      def fix(ctx: RewriteCtx): Patch
    }
    
  • scalafix.testkit.SemanticRewriteSuite is now now SemanticRuleSuite.

  • scalafix.config has been moved to scalafix.internal.config. Configuration case classes break binary compatility with every new field.

  • .symbol now returns Option[Symbol] instead of Symbol. .symbolOpt has been deprecated.

  • A large number of unused methods and classes inside scalafix.internal.util.Failure, scalafix.`package` and scalafix.syntax has been removed.

  • upgraded to Scalameta 2.0, which has several breaking changes in the Tree api.

  • The VolatileLazyVal rule is now named DottyVolatileLazyVal.

Contributors

git shortlog -sn --no-merges v0.4.2..v0.5.0-RC3 shows 5 people contributed to this release.

  • Ólafur Páll Geirsson
  • Gabriele Petronella
  • Guillaume Massé
  • Taisuke Oe
  • Andy Scott