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.11.0
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.1
Choose a head ref

Commits on Jun 3, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d2782e9 View commit details
  2. Merge pull request #349 from bjaglin/fixscripted

    fix test relying on ScalaTest 3.0.x
    bjaglin authored Jun 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b0a4266 View commit details

Commits on Jun 5, 2023

  1. Copy the full SHA
    8bb4fc5 View commit details

Commits on Jun 6, 2023

  1. Merge pull request #350 from scalacenter/example300

    ch.epfl.scala::example-scalafix-rule:3.0.0 is now available
    bjaglin authored Jun 6, 2023
    Copy the full SHA
    5c08e52 View commit details

Commits on Jun 15, 2023

  1. Copy the full SHA
    f41db12 View commit details
  2. Copy the full SHA
    8748495 View commit details
  3. Merge pull request #352 from scalacenter/update/interface-1.0.18

    Update interface to 1.0.18
    bjaglin authored Jun 15, 2023
    Copy the full SHA
    d5607ab View commit details
  4. Merge pull request #353 from scalacenter/update/scala-library-2.12.18

    Update scala-library to 2.12.18
    bjaglin authored Jun 15, 2023
    Copy the full SHA
    de065f3 View commit details

Commits on Jul 1, 2023

  1. Copy the full SHA
    0bfee9c View commit details
  2. Copy the full SHA
    c9d08a3 View commit details
  3. Copy the full SHA
    8e9638e View commit details
  4. Copy the full SHA
    d91c59e View commit details
  5. Merge pull request #358 from scalacenter/update/scalafmt-core-3.7.5

    Update scalafmt-core to 3.7.5
    bjaglin authored Jul 1, 2023
    Copy the full SHA
    cf8542d View commit details
  6. Merge pull request #357 from scalacenter/update/sbt-1.9.1

    Update sbt, scripted-plugin to 1.9.1
    bjaglin authored Jul 1, 2023
    Copy the full SHA
    c50cb8e View commit details
  7. Merge pull request #355 from scalacenter/update/org.eclipse.jgit-5.13…

    ….2.202306221912-r
    
    Update org.eclipse.jgit to 5.13.2.202306221912-r
    bjaglin authored Jul 1, 2023
    Copy the full SHA
    2d0d1a7 View commit details
  8. Merge pull request #354 from scalacenter/update/sbt-ci-release-1.5.12

    Update sbt-ci-release to 1.5.12
    bjaglin authored Jul 1, 2023
    Copy the full SHA
    920fe52 View commit details

Commits on Jul 15, 2023

  1. Copy the full SHA
    8f4a273 View commit details
  2. Copy the full SHA
    f1dd642 View commit details

Commits on Jul 16, 2023

  1. Merge pull request #359 from scalacenter/update/sbt-1.9.2

    Update sbt, scripted-plugin to 1.9.2
    bjaglin authored Jul 16, 2023
    Copy the full SHA
    6aa3715 View commit details
  2. Merge pull request #360 from scalacenter/update/scalafmt-core-3.7.9

    Update scalafmt-core to 3.7.9
    bjaglin authored Jul 16, 2023
    Copy the full SHA
    af88889 View commit details

Commits on Jul 26, 2023

  1. Add same license as scalafi

    bjaglin authored and julienrf committed Jul 26, 2023
    Copy the full SHA
    64eaaa5 View commit details

Commits on Aug 1, 2023

  1. Copy the full SHA
    229e14c View commit details
  2. Copy the full SHA
    b89bab4 View commit details
  3. Merge pull request #362 from scalacenter/update/sbt-1.9.3

    Update sbt, scripted-plugin to 1.9.3
    bjaglin authored Aug 1, 2023
    Copy the full SHA
    4a128ea View commit details
  4. Merge pull request #363 from scalacenter/update/scalafmt-core-3.7.11

    Update scalafmt-core to 3.7.11
    bjaglin authored Aug 1, 2023
    Copy the full SHA
    4f2b344 View commit details

Commits on Aug 15, 2023

  1. Copy the full SHA
    0ddb80c View commit details

Commits on Aug 23, 2023

  1. Merge pull request #364 from scalacenter/update/scalafmt-core-3.7.12

    Update scalafmt-core to 3.7.12
    bjaglin authored Aug 23, 2023
    Copy the full SHA
    bfe132f View commit details

Commits on Sep 1, 2023

  1. Copy the full SHA
    52a8bca View commit details
  2. Copy the full SHA
    22d7b1e View commit details

Commits on Sep 4, 2023

  1. Bump actions/checkout from 3 to 4

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 4, 2023
    Copy the full SHA
    506af1b View commit details

Commits on Sep 7, 2023

  1. Merge pull request #367 from scalacenter/dependabot/github_actions/ac…

    …tions/checkout-4
    
    Bump actions/checkout from 3 to 4
    bjaglin authored Sep 7, 2023
    Copy the full SHA
    a271b47 View commit details
  2. Merge pull request #366 from scalacenter/update/scalafmt-core-3.7.13

    Update scalafmt-core to 3.7.13
    bjaglin authored Sep 7, 2023
    Copy the full SHA
    e83ebf0 View commit details
  3. Merge pull request #365 from scalacenter/update/sbt-1.9.4

    Update sbt, scripted-plugin to 1.9.4
    bjaglin authored Sep 7, 2023
    Copy the full SHA
    15486ac View commit details

Commits on Sep 8, 2023

  1. Copy the full SHA
    fbf81cd View commit details

Commits on Sep 9, 2023

  1. Merge pull request #368 from scalacenter/latest-snapshot

    Latest scalafix SNAPSHOT for scala 2.13.12 support
    bjaglin authored Sep 9, 2023
    Copy the full SHA
    28a5665 View commit details

Commits on Sep 10, 2023

  1. scalafix/scalameta now requires newer scala versions

    semanticdb-scalac is now only published for the 4 latest patch releases
    for each minor scala version, see
    scalameta/scalameta#3250
    bjaglin committed Sep 10, 2023
    Copy the full SHA
    0e9d64a View commit details
  2. Copy the full SHA
    4ced96a View commit details

Commits on Sep 11, 2023

  1. Merge pull request #369 from bjaglin/actionnable-error

    better error reporting when semanticdb-scalac is not found
    bjaglin authored Sep 11, 2023
    Copy the full SHA
    e3c386d View commit details
  2. scalafix 0.11.1

    bjaglin authored Sep 11, 2023
    Copy the full SHA
    099aa21 View commit details
  3. Merge pull request #370 from scalacenter/scalafix0111

    scalafix 0.11.1
    bjaglin authored Sep 11, 2023
    Copy the full SHA
    1ba172c View commit details
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -9,14 +9,14 @@ jobs:
name: JDK8 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
- run: sbt test scripted
jdk11:
name: JDK11 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: adopt@1.11
@@ -25,7 +25,7 @@ jobs:
name: JDK17 tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
with:
java-version: 17
@@ -34,14 +34,14 @@ jobs:
name: Windows tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
- run: sbt ci-windows
shell: bash
checks:
name: Scalafmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- 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
@@ -7,7 +7,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: olafurpg/setup-scala@v14
- uses: olafurpg/setup-gpg@v3
- run: git fetch --unshallow
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.4"
version = "3.7.13"
project.git=true
align.preset=none
assumeStandardLibraryStripMargin = true
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2016-2023, EPFL

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ libraryDependencies ++= List(
"org.scalatest" %% "scalatest" % "3.2.16" % Test
)

scalaVersion := "2.12.17"
scalaVersion := "2.12.18"

// 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"
6 changes: 3 additions & 3 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.11.0"
def scalafixVersion: String = "0.11.1"

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

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
Compile / unmanagedSourceDirectories ++= {
32 changes: 32 additions & 0 deletions src/main/scala/scalafix/sbt/ScalafixPlugin.scala
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ import scalafix.internal.sbt._

import scala.collection.JavaConverters.collectionAsScalaIterableConverter
import scala.util.control.NoStackTrace
import sbt.librarymanagement.ResolveException

object ScalafixPlugin extends AutoPlugin {
override def trigger: PluginTrigger = allRequirements
@@ -164,6 +165,37 @@ object ScalafixPlugin extends AutoPlugin {
SettingKey[Boolean]("bspEnabled") := false
)
),
update := {
object SemanticdbScalac {
def unapply(id: ModuleID): Option[String] =
if (
id.organization == scalafixSemanticdb.organization &&
id.name.startsWith(scalafixSemanticdb.name)
) Some(id.revision)
else None
}

update.result.value match {
case Value(v) => v
case Inc(inc: Incomplete) =>
Incomplete.allExceptions(inc).toList match {
case (resolveException: ResolveException) :: Nil =>
resolveException.failed.headOption match {
case Some(SemanticdbScalac(rev)) =>
val scalaV = scalaVersion.value
val msg = s"The SemanticDB scalac plugin version ${rev} set up " +
"via `semanticdbVersion` does follow the version recommended " +
"for Scalafix, but is not supported for the outdated Scala " +
s"version ${scalaV}. Please upgrade to a more recent Scala " +
"patch version or uninstall sbt-scalafix."
throw inc.copy(message = Some(msg))
case _ =>
}
case _ =>
}
throw inc
}
},
ivyConfigurations += ScalafixConfig,
scalafixAll := scalafixAllInputTask.evaluated
)
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-1.5/scalafixEnable/build.sbt
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ lazy val scala211 = project
lazy val scala212 = project
.in(file("scala212"))
.settings(
scalaVersion := "2.12.17" // supported by semanticdb-scalac
scalaVersion := "2.12.18" // supported by semanticdb-scalac
)

lazy val scala3 = project
1 change: 1 addition & 0 deletions src/sbt-test/sbt-1.5/testkit/build.sbt
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ lazy val scala3Version = "3.0.0"

inThisBuild(
List(
scalaVersion := V.scala212, // don't let tests project fall back to sbt's old default
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
// need for sbt <1.7.0 as includePluginResolvers has no effect, see https://github.com/sbt/sbt/pull/6853
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@ package fix

import scalafix.testkit._
import scala.util.control.NonFatal
import org.scalatest.FunSuiteLike
import org.scalatest.funsuite.AnyFunSuiteLike
import org.scalatest.exceptions.TestFailedException

object IntputOutputSuite {
def main(args: Array[String]): Unit = {
if (Array("--save-expect").sameElements(args)) {
val suite = new AbstractSemanticRuleSuite with FunSuiteLike {
val suite = new AbstractSemanticRuleSuite with AnyFunSuiteLike {
override val props = TestkitProperties.loadFromResources()
override val isSaveExpect = true

@@ -30,6 +30,6 @@ object IntputOutputSuite {
}
}

class IntputOutputSuite extends AbstractSemanticRuleSuite with FunSuiteLike {
class IntputOutputSuite extends AbstractSemanticRuleSuite with AnyFunSuiteLike {
runAllTests()
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/basic/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild(
List(
scalaVersion := "2.12.14",
scalaVersion := "2.12.18",
libraryDependencies ++= List(
"org.scalameta" %% "testkit" % "4.3.10" % Test,
"org.scalameta" %% "munit" % "0.7.9" % Test,
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/inconfig/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild(
List(
scalaVersion := "2.12.14",
scalaVersion := "2.12.18",
libraryDependencies ++= List(
"org.scalameta" %% "testkit" % "4.3.10" % Test,
"org.scalameta" %% "munit" % "0.7.9" % Test,
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/root-validation/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild(
List(
scalaVersion := "2.12.14"
scalaVersion := "2.12.18"
)
)

2 changes: 1 addition & 1 deletion src/sbt-test/sbt-scalafix/semanticdb-enabled/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild(
List(
scalaVersion := "2.12.14",
scalaVersion := "2.12.18",
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision
)
22 changes: 22 additions & 0 deletions src/sbt-test/sbt-scalafix/unavailable-semanticdb-scalac/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
inThisBuild(
List(
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalaVersion := "2.13.7" // last semanticdb-scalac published for that scala version is 4.8.4
)
)

lazy val checkLogs =
taskKey[Unit]("Check presence of call to action in update logs")

checkLogs := {
val taskStreams = (update / streams).value
val reader = taskStreams.readText(taskStreams.key)
val logLines = Stream
.continually(reader.readLine())
.takeWhile(_ != null)
.force
assert(
logLines.exists(_.contains("Please upgrade to a more recent Scala patch version or uninstall sbt-scalafix"))
)
}
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"))
2 changes: 2 additions & 0 deletions src/sbt-test/sbt-scalafix/unavailable-semanticdb-scalac/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-> scalafix
> checkLogs
2 changes: 1 addition & 1 deletion src/sbt-test/skip-java17/scalafixResolvers/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scalaVersion := "2.12.7"
scalaVersion := "2.12.18"

TaskKey[Unit]("check") := {
val expectedRepositories: Seq[String] = Seq(
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ import org.scalatest.funsuite.AnyFunSuite

import scala.util.Properties

@org.scalatest.Ignore
class ScalafixAPISuite extends AnyFunSuite {

def assertNoDiff(obtained: String, expected: String)(implicit