diff --git a/.scalafmt.conf b/.scalafmt.conf index ee2b07b..48808a4 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.3" +version = "3.8.4-RC4" runner.dialect = scala3 align.preset = more diff --git a/build.sbt b/build.sbt index e9e7f70..1146ae4 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import org.typelevel.scalacoptions.ScalacOptions inThisBuild( Seq( - scalaVersion := "3.5.2", + scalaVersion := "3.6.2", versionScheme := Some("early-semver"), organization := "org.lichess.search", run / fork := true, @@ -24,7 +24,7 @@ val commonSettings = Seq( ScalacOptions.release("21"), ScalacOptions.other("-Wsafe-init") // fix in: https://github.com/typelevel/scalac-options/pull/136 ), - libraryDependencies += compilerPlugin("com.github.ghik" % "zerowaste" % "0.2.27" cross CrossVersion.full) + libraryDependencies += compilerPlugin("com.github.ghik" % "zerowaste" % "0.2.28" cross CrossVersion.full) ) lazy val core = project diff --git a/modules/app/src/main/scala/http.server.scala b/modules/app/src/main/scala/http.server.scala index e170028..11a9074 100644 --- a/modules/app/src/main/scala/http.server.scala +++ b/modules/app/src/main/scala/http.server.scala @@ -17,7 +17,7 @@ object MkHttpServer: def apply()(using server: MkHttpServer): MkHttpServer = server - given forAsyncLogger(using Logger[IO]): MkHttpServer = new: + given Logger[IO] => MkHttpServer = new: def newEmber(cfg: HttpServerConfig, httpApp: HttpApp[IO]): Resource[IO, Server] = EmberServerBuilder .default[IO] diff --git a/modules/app/src/main/scala/service.search.scala b/modules/app/src/main/scala/service.search.scala index d209c09..5e2677a 100644 --- a/modules/app/src/main/scala/service.search.scala +++ b/modules/app/src/main/scala/service.search.scala @@ -77,7 +77,7 @@ object SearchServiceImpl: given dateRange: Transformer.Derived[DateRange, Range[Instant]] = Transformer.Derived.FromFunction(r => Range(r.a.map(_.to[Instant]), r.b.map(_.to[Instant]))) - given Queryable[Query] with + given Queryable[Query]: def searchDef(query: Query)(from: From, size: Size) = query match case q: Query.Forum => q.to[Forum].searchDef(from, size) diff --git a/modules/client/src/main/scala/PlaySearchClient.scala b/modules/client/src/main/scala/PlaySearchClient.scala index 7cc1356..329a39a 100644 --- a/modules/client/src/main/scala/PlaySearchClient.scala +++ b/modules/client/src/main/scala/PlaySearchClient.scala @@ -57,10 +57,10 @@ object implicits: Query.schema.required[SearchInput]("query", _.query) )(SearchInput.apply) - given [A](using JsonCodec[A]): BodyWritable[A] = + given [A] => JsonCodec[A] => BodyWritable[A] = BodyWritable(a => InMemoryBody(ByteString.fromArrayUnsafe(writeToArray(a))), "application/json") - given [A](using JsonCodec[A]): BodyReadable[A] = + given [A] => JsonCodec[A] => BodyReadable[A] = BodyReadable(res => readFromArray(res.bodyAsBytes.toArray)) def apply(client: StandaloneWSClient, url: String)(using ExecutionContext): SearchService[Future] = diff --git a/modules/elastic/src/main/scala/ESClient.scala b/modules/elastic/src/main/scala/ESClient.scala index 0af4e5c..579a61d 100644 --- a/modules/elastic/src/main/scala/ESClient.scala +++ b/modules/elastic/src/main/scala/ESClient.scala @@ -63,7 +63,7 @@ object ESClient: ) ) - def apply[F[_]: MonadCancelThrow: Functor: Executor](client: ElasticClient, baseAttributes: Attributes)( + def apply[F[_]: { MonadCancelThrow, Functor, Executor }](client: ElasticClient, baseAttributes: Attributes)( metric: Histogram[F, Double] ) = new ESClient[F]: diff --git a/modules/ingestor/src/main/scala/Repo.scala b/modules/ingestor/src/main/scala/Repo.scala index a111cc3..0d782e1 100644 --- a/modules/ingestor/src/main/scala/Repo.scala +++ b/modules/ingestor/src/main/scala/Repo.scala @@ -26,7 +26,7 @@ object Repo: type MongoCollection = GenericMongoCollection[IO, Document, [A] =>> fs2.Stream[IO, A]] - given [A]: HasDocId[ChangeStreamDocument[A]] with + given [A] => HasDocId[ChangeStreamDocument[A]]: extension (change: ChangeStreamDocument[A]) def docId: Option[String] = change.documentKey.flatMap(_.id) diff --git a/modules/ingestor/src/main/scala/ingestor.scala b/modules/ingestor/src/main/scala/ingestor.scala index 319786f..a9c7641 100644 --- a/modules/ingestor/src/main/scala/ingestor.scala +++ b/modules/ingestor/src/main/scala/ingestor.scala @@ -22,7 +22,7 @@ trait Ingestor: object Ingestor: - given [A: Schema]: Indexable[A] = (a: A) => writeToString(a) + given [A] => Schema[A] => Indexable[A] = a => writeToString(a) def apply[A: Schema]( index: Index, diff --git a/modules/ingestor/src/test/scala/HasDocIdTest.scala b/modules/ingestor/src/test/scala/HasDocIdTest.scala index 016dd6e..9468617 100644 --- a/modules/ingestor/src/test/scala/HasDocIdTest.scala +++ b/modules/ingestor/src/test/scala/HasDocIdTest.scala @@ -11,7 +11,7 @@ import weaver.scalacheck.* object HasDocIdTest extends SimpleIOSuite with Checkers: case class Change(value: Int, docId: Option[String]) - given HasDocId[Change] with + given HasDocId[Change]: extension (a: Change) def docId: Option[String] = a.docId given Show[Change] = Show.fromToString diff --git a/project/plugins.sbt b/project/plugins.sbt index 910af21..51f2b22 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,6 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0") +resolvers += Resolver.sonatypeRepo("snapshots") +dependencyOverrides += "ch.epfl.scala" % "scalafix-interfaces" % "0.13.0+95-69a3e105-SNAPSHOT" addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.27") addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4") addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")