Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3.6.2 #392

Merged
merged 5 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.4-RC4"
runner.dialect = scala3

align.preset = more
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/http.server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/service.search.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions modules/client/src/main/scala/PlaySearchClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down
2 changes: 1 addition & 1 deletion modules/elastic/src/main/scala/ESClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]:

Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/main/scala/Repo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/main/scala/ingestor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/test/scala/HasDocIdTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
Loading