Skip to content

Conversation

@dwijnand
Copy link
Collaborator

@dwijnand dwijnand commented Jul 3, 2020

The new sbt-scalafix 0.9.18 release includes a
scalafixScalaBinaryVersion key that can be used to run, for instance,
the Scalafix for Scala 2.13 when running against sources compiled with
2.13.

Add those instructions to the README. The nice thing is this new
version and setting can be used the releases scala-rewrites 0.1.0.

But also add a sanity check to ExplicitNonNullaryApply (continuing to
copy from Scalafix's ExplicitResultTypes), with some fixing tips. This
is what it looks like on a test project:

[error] (scalafixAll) scalafix.sbt.InvalidArgument: Scala version mismatch:
(1) the target sources were compiled with Scala 2.13.2; (2) Scalafix is
running on Scala 2.12.11. To fix make scalafixScalaBinaryVersion == 2.13.
Try `ThisBuild / scalafixScalaBinaryVersion :=
CrossVersion.binaryScalaVersion(scalaVersion.value)`.

Also switch the docs to scalafixAll, and prep for a 0.1.1 release.

Fixes #43

The new sbt-scalafix 0.9.18 release includes a
scalafixScalaBinaryVersion key that can be used to run, for instance,
the Scalafix for Scala 2.13 when running against sources compiled with
2.13.

Add those instructions to the README.  The nice thing is this new
version and setting can be used the releases scala-rewrites 0.1.0.

But also add a sanity check to ExplicitNonNullaryApply (continuing to
copy from Scalafix's ExplicitResultTypes), with some fixing tips.  This
is what it looks like on a test project:

    [error] (scalafixAll) scalafix.sbt.InvalidArgument: Scala version mismatch:
    (1) the target sources were compiled with Scala 2.13.2; (2) Scalafix is
    running on Scala 2.12.11. To fix make scalafixScalaBinaryVersion == 2.13.
    Try `ThisBuild / scalafixScalaBinaryVersion :=
    CrossVersion.binaryScalaVersion(scalaVersion.value)`.

Also switch the docs to scalafixAll, and prep for a 0.1.1 release.
@dwijnand dwijnand merged commit 99cea05 into lightbend-labs:master Jul 3, 2020
@dwijnand dwijnand deleted the scalafixScalaBinaryVersion-doc-and-sanity branch July 3, 2020 16:36
@bjaglin
Copy link
Contributor

bjaglin commented Jul 3, 2020

Nice README! Also, that shows that scalafix-core should provide some plumbing so that advanced rules authors don't need to replicate what ExplicitResultTypes does.

@bjaglin
Copy link
Contributor

bjaglin commented Jul 3, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

"IllegalArgumentException: requirement failed" is not actionable

2 participants