Skip to content

Commit

Permalink
Merge pull request #195 from Dwolla/update/sbt-1.10.1
Browse files Browse the repository at this point in the history
Update sbt to 1.10.1
  • Loading branch information
mergify[bot] authored Jul 24, 2024
2 parents e9f0b8c + 5642f22 commit e75b873
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Add Scalafix to your project's build by [following the instructions](https://sca
1. Add the Scalafix plugin to the project by adding this to `project/plugins.sbt`:

```scala
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
```

2. Enable SemanticDB by adding this to `build.sbt`:
Expand All @@ -187,21 +187,14 @@ Add Scalafix to your project's build by [following the instructions](https://sca
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value)
ThisBuild / scalafixDependencies += "com.dwolla" %% "finagle-tagless-scalafix" % "0.2.0"
ThisBuild / scalafixDependencies += "com.dwolla" %% "finagle-tagless-scalafix" % "1.1.1"
```

3. Run the Scalafix rule automatically after generating the Thrift sources by adding this to `build.sbt`:

```scala
Compile / scalafix / unmanagedSources := (Compile / sources).value
Compile / compile := Def.taskDyn {
val compileOutput = (Compile / compile).value

Def.task {
(Compile / scalafix).toTask(" AddCatsTaglessInstances").value
compileOutput
}
}.value
scalafixOnCompile := true
libraryDependencies ++= {
val catsTaglessV = "0.14.0"
Seq(
Expand All @@ -211,6 +204,12 @@ Add Scalafix to your project's build by [following the instructions](https://sca
}
```

and adding this to `.scalafix.conf`:

```hocon
triggered.rules = [ AddCatsTaglessInstances ]
```

### `AddCatsTaglessInstances`

The `AddCatsTaglessInstances` rule finds generated Thrift service traits and adds implicit instances of
Expand Down
2 changes: 1 addition & 1 deletion project/AsyncUtilsBuildPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object AsyncUtilsBuildPlugin extends AutoPlugin {

private val supportedVersions = (currentTwitterVersion :: oldVersions).sorted.reverse

private val SCALA_2_13: String = "2.13.13"
private val SCALA_2_13: String = "2.13.14"
private val SCALA_2_12 = "2.12.19"
private val Scala2Versions: Seq[String] = Seq(SCALA_2_13, SCALA_2_12)

Expand Down
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.9
sbt.version=1.10.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel-mergify" % "0.7.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.7.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.10.0")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.eed3si9n.expecty.Expecty.expect
import munit.FunSuite
import scalafix.Patch

import scala.meta._
import scala.meta.*

class AddCatsTaglessInstancesTest extends FunSuite {

Expand Down Expand Up @@ -69,7 +69,7 @@ class AddCatsTaglessInstancesTest extends FunSuite {

test("add SimpleService companion object with implicits") {
val expectedPatchContent =
"""Add(}, RightBrace(}) [467..468), }
"""Add(}, RightBrace [467..468), }
|
| object SimpleService {
| implicit def SimpleServiceInReaderT[F[_]]: SimpleService[({type Λ[β0] = _root_.cats.data.ReaderT[F, SimpleService[F], β0]})#Λ] =
Expand All @@ -92,12 +92,12 @@ class AddCatsTaglessInstancesTest extends FunSuite {

test("add replacement MethodPerEndpoint that extends SimpleService[Future]") {
val expectedPatchContent =
"""Add(}, RightBrace(}) [467..468), }
"""Add(}, RightBrace [467..468), }
| trait MethodPerEndpoint extends SimpleService[Future])""".stripMargin

expect(patch.toString.contains(expectedPatchContent))
}

test("the patches don't touch SimpleService2, which has already been fixed") {
expect(!patch.toString.contains("SimpleService2"))
expect(!patch.toString.contains(s"Add(Future, Future [${range("Future")(input.lastIndexOf)}), F)"))
Expand Down

0 comments on commit e75b873

Please sign in to comment.