-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow usage of rules compiled against 2.11 & 2.13
Benefits 1. Rules using the presentation compiler can now work on 2.11 and 2.13 input as long as they are cross-compiled 2. Advanced users with local rules targeting 2.11 or 2.13 code will be able to simplify their build 2.12 remains the default until 1.0 to be backward compatible with external rules (i.e loaded through `scalafixDependencies` or `dependency:`) that are not (yet) cross-compiled
- Loading branch information
1 parent
3c62af2
commit e6c40bd
Showing
10 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import _root_.scalafix.sbt.{BuildInfo => V} | ||
|
||
inThisBuild( | ||
List( | ||
addCompilerPlugin(scalafixSemanticdb), | ||
scalacOptions += "-Yrangepos", | ||
scalaVersion := V.scala211, | ||
scalafixScalaVersion := scalaVersion.value // this should be the default in 1.x | ||
) | ||
) |
2 changes: 2 additions & 0 deletions
2
src/sbt-test/sbt-scalafix/scalafixScalaVersion/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resolvers += Resolver.sonatypeRepo("public") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % sys.props("plugin.version")) |
6 changes: 6 additions & 0 deletions
6
src/sbt-test/sbt-scalafix/scalafixScalaVersion/src/main/scala/NeedExplicitResultTypes.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
object NeedExplicitResultTypes { | ||
def a = { | ||
println("foobar") | ||
123 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ExplicitResultTypes uses the presentation compiler so the rule must run with the same scala binary version as the target | ||
-> scalafix --check ExplicitResultTypes | ||
> scalafix ExplicitResultTypes | ||
> scalafix --check ExplicitResultTypes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters