Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scalacenter/sbt-scalafix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.4
Choose a base ref
...
head repository: scalacenter/sbt-scalafix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.0
Choose a head ref

Commits on Oct 15, 2022

  1. Copy the full SHA
    5577f84 View commit details
  2. Copy the full SHA
    7b171c9 View commit details
  3. Copy the full SHA
    4a30611 View commit details
  4. Copy the full SHA
    b7e1d36 View commit details
  5. Merge pull request #322 from scala-steward/update/scalatest-3.2.14

    Update scalatest to 3.2.14
    bjaglin authored Oct 15, 2022
    Copy the full SHA
    64d7c53 View commit details
  6. Merge pull request #321 from scala-steward/update/sbt-1.7.2

    Update sbt, scripted-plugin to 1.7.2
    bjaglin authored Oct 15, 2022
    Copy the full SHA
    93a5503 View commit details
  7. Merge pull request #320 from scala-steward/update/scala-library-2.12.17

    Update scala-library to 2.12.17
    bjaglin authored Oct 15, 2022
    Copy the full SHA
    6acbe74 View commit details
  8. Merge pull request #319 from scala-steward/update/interface-1.0.9

    Update interface to 1.0.9
    bjaglin authored Oct 15, 2022
    Copy the full SHA
    a590175 View commit details

Commits on Nov 2, 2022

  1. sbt 1.7.3

    bjaglin committed Nov 2, 2022
    Copy the full SHA
    7affe62 View commit details
  2. Copy the full SHA
    1016286 View commit details

Commits on Nov 14, 2022

  1. Merge pull request #323 from bjaglin/sbt173

    sbt 1.7.3
    bjaglin authored Nov 14, 2022
    Copy the full SHA
    5180759 View commit details

Commits on Dec 1, 2022

  1. Copy the full SHA
    495b6ee View commit details
  2. Copy the full SHA
    e19aa8b View commit details
  3. Copy the full SHA
    a2bd06c View commit details

Commits on Dec 15, 2022

  1. Merge pull request #325 from scalacenter/update/interface-1.0.11

    Update interface to 1.0.11
    bjaglin authored Dec 15, 2022
    Copy the full SHA
    b38566b View commit details
  2. Merge pull request #327 from scalacenter/update/sbt-1.8.0

    Update sbt, scripted-plugin to 1.8.0
    bjaglin authored Dec 15, 2022
    Copy the full SHA
    00fdf73 View commit details
  3. Merge pull request #328 from scalacenter/update/scalafmt-core-3.6.1

    Update scalafmt-core to 3.6.1
    bjaglin authored Dec 15, 2022
    Copy the full SHA
    668c98d View commit details

Commits on Jan 1, 2023

  1. Copy the full SHA
    bf29422 View commit details

Commits on Jan 2, 2023

  1. Merge pull request #329 from scalacenter/update/interface-1.0.12

    Update interface to 1.0.12
    bjaglin authored Jan 2, 2023
    Copy the full SHA
    f9971d0 View commit details
  2. don't force slf4j 2

    bjaglin authored Jan 2, 2023
    Copy the full SHA
    f414886 View commit details
  3. Merge pull request #330 from scalacenter/slf4j

    don't force slf4j 2
    bjaglin authored Jan 2, 2023
    Copy the full SHA
    588642d View commit details

Commits on Jan 15, 2023

  1. Copy the full SHA
    fc1dc7b View commit details
  2. Copy the full SHA
    2a8c307 View commit details
  3. Merge pull request #332 from scalacenter/update/sbt-1.8.2

    Update sbt, scripted-plugin to 1.8.2
    bjaglin authored Jan 15, 2023
    Copy the full SHA
    a46fe58 View commit details
  4. Merge pull request #333 from scalacenter/update/scalatest-3.2.15

    Update scalatest to 3.2.15
    bjaglin authored Jan 15, 2023
    Copy the full SHA
    09ed18e View commit details

Commits on Jan 29, 2023

  1. drop support for Scala 2.11

    bjaglin committed Jan 29, 2023
    Copy the full SHA
    e81473c View commit details
  2. Copy the full SHA
    491958d View commit details

Commits on Jan 30, 2023

  1. Merge pull request #334 from bjaglin/scala211

    drop support for Scala 2.11
    bjaglin authored Jan 30, 2023
    Copy the full SHA
    9b81b76 View commit details
  2. overriden scalacOptions are not supported by scalafixEnable

    SemanticDbPlugin scalacOptions are not easy to re-inject, and behavior
    varies between 1.3.x and later (sbt/sbt#5887),
    so it's better to clarify in the scripted that we only support relaxing
    fatal warnings and can no longer support 27d8eb5, which was working only
    when SemanticDbPlugin was not used (sbt <1.3).
    bjaglin committed Jan 30, 2023
    Copy the full SHA
    785d92d View commit details
  3. Merge pull request #335 from bjaglin/cantfixoverridenscalac

    overriden scalacOptions are not supported by scalafixEnable
    bjaglin authored Jan 30, 2023
    Copy the full SHA
    5fd9592 View commit details

Commits on Feb 20, 2023

  1. Bump olafurpg/setup-scala from 13 to 14

    Bumps [olafurpg/setup-scala](https://github.com/olafurpg/setup-scala) from 13 to 14.
    - [Release notes](https://github.com/olafurpg/setup-scala/releases)
    - [Commits](olafurpg/setup-scala@v13...v14)
    
    ---
    updated-dependencies:
    - dependency-name: olafurpg/setup-scala
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 20, 2023
    Copy the full SHA
    de7b3a9 View commit details

Commits on Mar 15, 2023

  1. Copy the full SHA
    b29eebb View commit details

Commits on Mar 19, 2023

  1. Merge pull request #337 from scalacenter/8c08dependabot/github_action…

    …s/olafurpg/setup-scala-14
    
    Bump olafurpg/setup-scala from 13 to 14
    bjaglin authored Mar 19, 2023
    Copy the full SHA
    aeceba2 View commit details
  2. Merge pull request #338 from scalacenter/update/scalafmt-core-3.7.2

    Update scalafmt-core to 3.7.2
    bjaglin authored Mar 19, 2023
    Copy the full SHA
    2051bf0 View commit details

Commits on Apr 1, 2023

  1. Copy the full SHA
    e5dcfac View commit details

Commits on Apr 15, 2023

  1. Copy the full SHA
    4ffa431 View commit details
  2. Merge pull request #340 from scalacenter/update/scalafmt-core-3.7.3

    Update scalafmt-core to 3.7.3
    bjaglin authored Apr 15, 2023
    Copy the full SHA
    0b05ce2 View commit details
  3. Merge pull request #341 from scalacenter/update/interface-1.0.15

    Update interface to 1.0.15
    bjaglin authored Apr 15, 2023
    Copy the full SHA
    b5c4405 View commit details

Commits on May 15, 2023

  1. Copy the full SHA
    933843f View commit details
  2. Copy the full SHA
    8964511 View commit details
  3. Merge pull request #342 from scalacenter/update/interface-1.0.16

    Update interface to 1.0.16
    bjaglin authored May 15, 2023
    Copy the full SHA
    f84efda View commit details
  4. Merge pull request #343 from scalacenter/update/sbt-1.8.3

    Update sbt, scripted-plugin to 1.8.3
    bjaglin authored May 15, 2023
    Copy the full SHA
    f128885 View commit details

Commits on Jun 1, 2023

  1. Copy the full SHA
    db89411 View commit details
  2. Copy the full SHA
    669875b View commit details
  3. Merge pull request #345 from scalacenter/update/scalatest-3.2.16

    Update scalatest to 3.2.16
    bjaglin authored Jun 1, 2023
    Copy the full SHA
    e2963f2 View commit details
  4. Merge pull request #344 from scalacenter/update/scalafmt-core-3.7.4

    Update scalafmt-core to 3.7.4
    bjaglin authored Jun 1, 2023
    Copy the full SHA
    98b5af2 View commit details

Commits on Jun 3, 2023

  1. sbt 1.9.0

    bjaglin authored Jun 3, 2023
    Copy the full SHA
    1f6bde0 View commit details
  2. Merge pull request #347 from scalacenter/sbt19

    sbt 1.9.0
    bjaglin authored Jun 3, 2023
    Copy the full SHA
    a158b91 View commit details
  3. Scalafix 0.11.0

    bjaglin committed Jun 3, 2023
    Copy the full SHA
    004ca18 View commit details
  4. Merge pull request #348 from scalacenter/scalafix0110

    Scalafix 0.11.0
    bjaglin authored Jun 3, 2023
    Copy the full SHA
    82632cc View commit details
Showing with 100 additions and 121 deletions.
  1. +5 −5 .github/workflows/ci.yml
  2. +1 −1 .github/workflows/release.yml
  3. +1 −1 .scalafmt.conf
  4. +3 −3 build.sbt
  5. +2 −2 project/Dependencies.scala
  6. +1 −1 project/build.properties
  7. +1 −1 project/plugins.sbt
  8. +5 −0 src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala
  9. +3 −3 src/main/scala/scalafix/sbt/BuildInfo.scala
  10. +1 −1 src/main/scala/scalafix/sbt/ScalafixTestkitPlugin.scala
  11. +7 −1 src/sbt-test/sbt-1.5/scalafixEnable/build.sbt
  12. 0 ...t/{sbt-scalafix/cross-build/scala210 → sbt-1.5/scalafixEnable/scala212}/src/main/scala/Main.scala
  13. +6 −5 src/sbt-test/sbt-1.5/scalafixEnable/test
  14. +5 −8 src/sbt-test/sbt-1.5/testkit/build.sbt
  15. +1 −1 src/sbt-test/sbt-scalafix/basic/build.sbt
  16. +0 −9 src/sbt-test/sbt-scalafix/cross-build/build.sbt
  17. +0 −7 src/sbt-test/sbt-scalafix/cross-build/scala210/src/test/scala/MainTest.scala
  18. +0 −7 src/sbt-test/sbt-scalafix/cross-build/scala211/src/main/scala/Main.scala
  19. +0 −7 src/sbt-test/sbt-scalafix/cross-build/scala211/src/test/scala/MainTest.scala
  20. +1 −4 src/sbt-test/sbt-scalafix/cross-build/test
  21. +1 −1 src/sbt-test/sbt-scalafix/inconfig/build.sbt
  22. +40 −38 src/sbt-test/sbt-scalafix/scalafixEnable/build.sbt
  23. 0 src/sbt-test/sbt-scalafix/scalafixEnable/{scala212 → config}/src/test/scala/UnusedImports.scala
  24. +4 −10 src/sbt-test/sbt-scalafix/scalafixEnable/project/FatalWarningsPlugin.scala
  25. +3 −3 src/sbt-test/sbt-scalafix/scalafixEnable/test
  26. +1 −0 src/test/scala/scalafix/internal/sbt/SbtCompletionsSuite.scala
  27. +8 −2 src/test/scala/scalafix/internal/sbt/ScalafixAPISuite.scala
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
- run: sbt test scripted
jdk11:
name: JDK11 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
with:
java-version: adopt@1.11
- run: sbt test scripted
@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
with:
java-version: 17
- run: sbt "test; scripted sbt-scalafix/*"
@@ -35,13 +35,13 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
- run: sbt ci-windows
shell: bash
checks:
name: Scalafmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
- run: ./bin/scalafmt --test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
- uses: olafurpg/setup-gpg@v3
- run: git fetch --unshallow
- name: Publish ${{ github.ref }}
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.5.9"
version = "3.7.4"
project.git=true
align.preset=none
assumeStandardLibraryStripMargin = true
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -38,14 +38,14 @@ commands += Command.command("ci-windows") { s =>
}

// Dependencies
resolvers += Resolver.sonatypeRepo("public")
resolvers ++= Resolver.sonatypeOssRepos("public")
libraryDependencies ++= Dependencies.all
libraryDependencies ++= List(
"com.lihaoyi" %% "fansi" % "0.4.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.13" % Test
"org.scalatest" %% "scalatest" % "3.2.16" % Test
)

scalaVersion := "2.12.16"
scalaVersion := "2.12.17"

// keep this as low as possible to avoid running into binary incompatibility such as https://github.com/sbt/sbt/issues/5049
pluginCrossBuild / sbtVersion := "1.3.1"
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ import sbt._

object Dependencies {
val x = List(1) // scalafix:ok
def scalafixVersion: String = "0.10.4"
def scalafixVersion: String = "0.11.0"

val all = List(
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.1.202206130422-r",
"ch.epfl.scala" % "scalafix-interfaces" % scalafixVersion,
"io.get-coursier" % "interface" % "1.0.8"
"io.get-coursier" % "interface" % "1.0.16"
)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.1
sbt.version=1.9.0
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolvers += Resolver.sonatypeRepo("public")
resolvers ++= Resolver.sonatypeOssRepos("public")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
5 changes: 5 additions & 0 deletions src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala
Original file line number Diff line number Diff line change
@@ -129,6 +129,11 @@ object ScalafixInterface {
"Rules such as ExplicitResultTypes requiring the project version to match the Scalafix " +
"version are unsupported for the moment."
)
else if (scalafixBinaryScalaVersion == "2.11")
logger.error(
"Scala 2.11 is no longer supported. Please downgrade to the final version supporting " +
"it: sbt-scalafix 0.10.4."
)
val callback = new ScalafixLogger(logger)
val scalafixArguments = ScalafixAPI
.fetchAndClassloadInstance(
6 changes: 3 additions & 3 deletions src/main/scala/scalafix/sbt/BuildInfo.scala
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ object BuildInfo {
property("scala213")
def scala212: String =
property("scala212")
def scala211: String =
property("scala211")
@deprecated("Scala 2.11 is no longer supported", ">0.10.4")
def scala211: String = ???
def supportedScalaVersions: List[String] =
List(scala213, scala212, scala211)
List(scala213, scala212)

private val propertiesPath = "scalafix-interfaces.properties"

2 changes: 1 addition & 1 deletion src/main/scala/scalafix/sbt/ScalafixTestkitPlugin.scala
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ object ScalafixTestkitPlugin extends AutoPlugin {
// This makes it simpler to use sbt-scalafix SNAPSHOTS: such snapshots may bring scalafix-* SNAPSHOTS which is fine in the
// meta build as the same resolver (declared in project/plugins.sbt) is used. However, since testkit-enabled projects are
// built against a version of scalafix-testkit dictated by scalafix.sbt.BuildInfo.scalafixVersion, the same resolver is
// needed here as well.
// needed here as well. Unfortunately it works only for sbt 1.7+, see https://github.com/sbt/sbt/pull/6849.
includePluginResolvers := true
)

8 changes: 7 additions & 1 deletion src/sbt-test/sbt-1.5/scalafixEnable/build.sbt
Original file line number Diff line number Diff line change
@@ -9,7 +9,13 @@ lazy val scala210 = project
lazy val scala211 = project
.in(file("scala211"))
.settings(
scalaVersion := "2.11.12" // supported by semanticdb-scalac
scalaVersion := "2.11.12" // supported by semanticdb-scalac, but not by sbt-scalafix
)

lazy val scala212 = project
.in(file("scala212"))
.settings(
scalaVersion := "2.12.17" // supported by semanticdb-scalac
)

lazy val scala3 = project
11 changes: 6 additions & 5 deletions src/sbt-test/sbt-1.5/scalafixEnable/test
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# enable semanticdb output where supported
> scalafixEnable

# check that projects not supported by semanticdb-scalac can still compile
# check that projects not supported by sbt-scalafix can still compile
> scala210/compile
> scala211/compile

# check that we can run a semantic rule against a Scala 2.11 dialect source file
-> scala211/scalafix --check SemanticRule
> scala211/scalafix SemanticRule
> scala211/scalafix --check SemanticRule
# check that we can run a semantic rule against a Scala 2.12 dialect source file
-> scala212/scalafix --check SemanticRule
> scala212/scalafix SemanticRule
> scala212/scalafix --check SemanticRule

# check that we can run a semantic rule against a Scala 3 dialect source file
-> scala3/scalafix --check SemanticRule
13 changes: 5 additions & 8 deletions src/sbt-test/sbt-1.5/testkit/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
lazy val V = _root_.scalafix.sbt.BuildInfo

lazy val rulesCrossVersions = Seq(V.scala213, V.scala212, V.scala211)
lazy val rulesCrossVersions = Seq(V.scala213, V.scala212)
lazy val scala3Version = "3.0.0"

inThisBuild(
List(
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision
semanticdbVersion := scalafixSemanticdb.revision,
// need for sbt <1.7.0 as includePluginResolvers has no effect, see https://github.com/sbt/sbt/pull/6853
resolvers += Resolver.sonatypeRepo("public")
)
)

@@ -26,7 +28,7 @@ lazy val input = projectMatrix
scalacOptions += "-Xsource:3"
)
)
.jvmPlatform(scalaVersions = Seq(V.scala212, V.scala211))
.jvmPlatform(scalaVersions = Seq(V.scala212))

lazy val output = projectMatrix
.defaultAxes(VirtualAxis.jvm)
@@ -71,10 +73,5 @@ lazy val tests = projectMatrix
axisValues = Seq(TargetAxis(V.scala212), VirtualAxis.jvm),
settings = Seq()
)
.customRow(
scalaVersions = Seq(V.scala211),
axisValues = Seq(TargetAxis(V.scala211), VirtualAxis.jvm),
settings = Seq()
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/basic/build.sbt
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ inThisBuild(
"org.scalameta" %% "testkit" % "4.3.10" % Test,
"org.scalameta" %% "munit" % "0.7.9" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test,
"org.scalatest" %% "scalatest" % "3.2.13" % Test
"org.scalatest" %% "scalatest" % "3.2.16" % Test
),
scalafixDependencies := List(
// Custom rule published to Maven Central https://github.com/scalacenter/example-scalafix-rule
9 changes: 0 additions & 9 deletions src/sbt-test/sbt-scalafix/cross-build/build.sbt
Original file line number Diff line number Diff line change
@@ -16,19 +16,10 @@ lazy val root = project
.in(file("."))
.aggregate(
javaProject,
scala211,
scala210,
scala212,
scala213
)

lazy val scala210 = project.settings(
scalaVersion := "2.10.7"
)
lazy val scala211 = project.settings(
scalaVersion := Versions.scala211,
scalafixSettings
)
lazy val scala212 = project
.configs(IntegrationTest)
.settings(

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 1 addition & 4 deletions src/sbt-test/sbt-scalafix/cross-build/test
Original file line number Diff line number Diff line change
@@ -22,10 +22,7 @@
> it:scalafix --test ProcedureSyntax

> javaProject/compile:scalafix ProcedureSyntax
# Should fail because 2.10 has no semanticdb
# Other >2.10 projects should succeed
-> compile:scalafix
-> test:scalafix

# it config exists only for 2.12
> it:scalafix

2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/inconfig/build.sbt
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ inThisBuild(
"org.scalameta" %% "testkit" % "4.3.10" % Test,
"org.scalameta" %% "munit" % "0.7.9" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test,
"org.scalatest" %% "scalatest" % "3.2.13" % Test
"org.scalatest" %% "scalatest" % "3.2.16" % Test
),
scalafixDependencies := List(
// Custom rule published to Maven Central https://github.com/scalacenter/example-scalafix-rule
78 changes: 40 additions & 38 deletions src/sbt-test/sbt-scalafix/scalafixEnable/build.sbt
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
val V = _root_.scalafix.sbt.BuildInfo

// 2.10 is not supported
lazy val scala210 = project.settings(
scalaVersion := "2.10.4",
libraryDependencies := Nil,
scalacOptions := Nil
lazy val config = project

lazy val unsupported = project.settings(
// 2.11.x is not supported
scalaVersion := "2.11.12"
)

// 2.11.x is supported
lazy val scala211_old = project.settings(
// semanticdb-scalac_2.11.0 was never available
scalaVersion := "2.11.0"
lazy val bumpScala = project.settings(
// semanticdb-scalac_2.12.0 was never available
scalaVersion := "2.12.0"
)

// 2.11.x is supported
lazy val scala211 = project.settings(
// semanticdb-scalac_2.11.11 no longer available after 4.1.9
scalaVersion := "2.11.11"
lazy val downgradeScalameta = project.settings(
// semanticdb-scalac_2.12.4 no longer available after 4.1.9
scalaVersion := "2.12.4"
)

// 2.12.x is supported
lazy val scala212 = project.settings(
lazy val upgradeScalameta = project.settings(
// semanticdb-scalac_2.12.15 not yet available in 4.4.10, became available as of 4.4.28
scalaVersion := "2.12.15"
)

// 2.13.x is supported
lazy val scala213 = project.settings(
// semanticdb-scalac_2.13.4 available in 4.4.10, became available as of 4.4.0
lazy val available = project.settings(
// semanticdb-scalac_2.13.4 available in 4.4.10
scalaVersion := "2.13.4",
crossScalaVersions := Seq("2.12.15")
)

TaskKey[Unit]("check") := {
assert((scala210 / semanticdbEnabled).value == false)
assert((scala210 / scalaVersion).value == "2.10.4")
assert((scala210 / Compile / compile / scalacOptions).value.isEmpty)
assert((unsupported / semanticdbEnabled).value == false)
assert((unsupported / scalaVersion).value == "2.11.12")
assert((unsupported / Compile / compile / scalacOptions).value.isEmpty)

assert((scala211_old / semanticdbEnabled).value == true)
assert((scala211_old / scalaVersion).value == "2.11.12")
assert((scala211_old / semanticdbCompilerPlugin).value.revision == "4.4.10")
assert((bumpScala / semanticdbEnabled).value == true)
assert((bumpScala / scalaVersion).value == V.scala212)
assert(
(bumpScala / semanticdbCompilerPlugin).value.revision == V.scalametaVersion
)
assert(
(scala211_old / Compile / compile / scalacOptions).value
(bumpScala / Compile / compile / scalacOptions).value
.count(_ == "-Yrangepos") == 1
)

assert((scala211 / semanticdbEnabled).value == true)
assert((scala211 / scalaVersion).value == "2.11.11")
assert((scala211 / semanticdbCompilerPlugin).value.revision == "4.1.9")
assert((downgradeScalameta / semanticdbEnabled).value == true)
assert((downgradeScalameta / scalaVersion).value == "2.12.4")
assert(
(scala211 / Compile / compile / scalacOptions).value
(downgradeScalameta / semanticdbCompilerPlugin).value.revision == "4.1.9"
)
assert(
(downgradeScalameta / Compile / compile / scalacOptions).value
.count(_ == "-Yrangepos") == 1
)

assert((scala212 / semanticdbEnabled).value == true)
assert((scala212 / scalaVersion).value == "2.12.15")
assert((scala212 / semanticdbCompilerPlugin).value.revision == "4.4.28")
assert((upgradeScalameta / semanticdbEnabled).value == true)
assert((upgradeScalameta / scalaVersion).value == "2.12.15")
assert(
(upgradeScalameta / semanticdbCompilerPlugin).value.revision == "4.4.28"
)
assert(
(scala212 / Compile / compile / scalacOptions).value
(upgradeScalameta / Compile / compile / scalacOptions).value
.count(_ == "-Yrangepos") == 1
)

assert((scala213 / semanticdbEnabled).value == true)
assert((scala213 / scalaVersion).value == "2.13.4")
assert((scala213 / semanticdbCompilerPlugin).value.revision == "4.4.10")
assert((available / semanticdbEnabled).value == true)
assert((available / scalaVersion).value == "2.13.4")
assert((available / semanticdbCompilerPlugin).value.revision == "4.4.10")
assert(
(scala213 / Test / compile / scalacOptions).value
(available / Test / compile / scalacOptions).value
.count(_ == "-Yrangepos") == 1
)
}

TaskKey[Unit]("checkVersion") := {
assert((scala213 / scalaVersion).value == "2.12.15")
assert((available / scalaVersion).value == "2.12.15")
}
Loading