diff --git a/build.sbt b/build.sbt index c5a6516c..b9a5edb3 100644 --- a/build.sbt +++ b/build.sbt @@ -19,7 +19,7 @@ import com.github.sbt.git.SbtGit.GitKeys._ organization := "io.renku" name := "renku-search" -ThisBuild / scalaVersion := "3.3.3" +ThisBuild / scalaVersion := Dependencies.V.scala // This project contains nothing to package, like pure POM maven project packagedArtifacts := Map.empty diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroIO.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroIO.scala index 17ffc392..38bc5d95 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroIO.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroIO.scala @@ -25,8 +25,8 @@ trait AvroIO extends AvroWriter with AvroReader object AvroIO: def apply(schema: Schema): AvroIO = new AvroIO: - private[this] val reader = AvroReader(schema) - private[this] val writer = AvroWriter(schema) + private val reader = AvroReader(schema) + private val writer = AvroWriter(schema) override def write[A: AvroEncoder](values: Seq[A]): ByteVector = writer.write(values) diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroReader.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroReader.scala index a7d2de0e..bc4a5a0c 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroReader.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroReader.scala @@ -41,7 +41,7 @@ object AvroReader: def apply(schema: Schema): AvroReader = new Impl(schema) private class Impl(schema: Schema) extends AvroReader: - private[this] val reader = new GenericDatumReader[Any](schema) + private val reader = new GenericDatumReader[Any](schema) extension (self: DatumReader[Any]) def readOpt[A: AvroDecoder](decoder: Decoder): Option[A] = diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroWriter.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroWriter.scala index e1df9edc..eb9918c8 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroWriter.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/AvroWriter.scala @@ -41,7 +41,7 @@ object AvroWriter: new Impl(schema, codecFactory) private class Impl(schema: Schema, cf: CodecFactory) extends AvroWriter: - private[this] val writer = new GenericDatumWriter[Any](schema) + private val writer = new GenericDatumWriter[Any](schema) def write[A: AvroEncoder](values: Seq[A]): ByteVector = write0(out => EncoderFactory.get().binaryEncoder(out, null), values) diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/ByteVectorInput.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/ByteVectorInput.scala index 9b26f426..7861d1a4 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/ByteVectorInput.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/ByteVectorInput.scala @@ -27,7 +27,7 @@ final class ByteVectorInput(val bytes: ByteVector) extends InputStream with SeekableInput { - private[this] var position: Long = 0 + private var position: Long = 0 override def seek(p: Long): Unit = position = p diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/decoders/RecordDecoders.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/decoders/RecordDecoders.scala index 3c1fea93..ff5a29fc 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/decoders/RecordDecoders.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/decoders/RecordDecoders.scala @@ -64,7 +64,7 @@ object RecordDecoders: ) } - inline def summonAll[T <: Tuple]: List[AvroDecoder[_]] = + inline def summonAll[T <: Tuple]: List[AvroDecoder[?]] = inline erasedValue[T] match case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[AvroDecoder[t]] :: summonAll[ts] diff --git a/modules/avro-codec/src/main/scala/io/renku/avro/codec/encoders/RecordEncoders.scala b/modules/avro-codec/src/main/scala/io/renku/avro/codec/encoders/RecordEncoders.scala index 0d0b8206..bb67bf76 100644 --- a/modules/avro-codec/src/main/scala/io/renku/avro/codec/encoders/RecordEncoders.scala +++ b/modules/avro-codec/src/main/scala/io/renku/avro/codec/encoders/RecordEncoders.scala @@ -52,7 +52,7 @@ object RecordEncoders { AvroRecord(schema, fields) } - inline def summonAll[T <: Tuple]: List[AvroEncoder[_]] = + inline def summonAll[T <: Tuple]: List[AvroEncoder[?]] = inline erasedValue[T] match case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[AvroEncoder[t]] :: summonAll[ts] diff --git a/modules/http4s-borer/src/main/scala/io/renku/search/http/borer/StreamDecode.scala b/modules/http4s-borer/src/main/scala/io/renku/search/http/borer/StreamDecode.scala index 6d1eb8e2..355f805b 100644 --- a/modules/http4s-borer/src/main/scala/io/renku/search/http/borer/StreamDecode.scala +++ b/modules/http4s-borer/src/main/scala/io/renku/search/http/borer/StreamDecode.scala @@ -50,7 +50,7 @@ object StreamDecode { Pull.pure(None) }) - private[this] val curlyClose = Chunk('}'.toByte) + private val curlyClose = Chunk('}'.toByte) private def decodeCont[A]( decode: Input[Array[Byte]] => DecodingSetup.Sealed[A] )(input: Chunk[Byte]): Either[Throwable, (Vector[A], Chunk[Byte])] = { diff --git a/modules/redis-client/src/main/scala/io/renku/redis/client/RedisQueueClient.scala b/modules/redis-client/src/main/scala/io/renku/redis/client/RedisQueueClient.scala index 7d8adeea..5c5e1806 100644 --- a/modules/redis-client/src/main/scala/io/renku/redis/client/RedisQueueClient.scala +++ b/modules/redis-client/src/main/scala/io/renku/redis/client/RedisQueueClient.scala @@ -103,7 +103,7 @@ class RedisQueueClientImpl[F[_]: Async: Log](client: RedisClient) (rm.body.get(MessageBodyKeys.headers), rm.body.get(MessageBodyKeys.payload)) .mapN(RedisMessage(MessageId(rm.id.value), _, _)) - lazy val logInfo: ((XReadMessage[_, _], Option[RedisMessage])) => F[Unit] = { + lazy val logInfo: ((XReadMessage[?, ?], Option[RedisMessage])) => F[Unit] = { case (m, None) => Log[F].info( s"Message '${m.id}' skipped as it has no '${MessageBodyKeys.headers}' or '${MessageBodyKeys.payload}'" diff --git a/modules/redis-client/src/test/scala/io/renku/redis/client/util/RedisSpec.scala b/modules/redis-client/src/test/scala/io/renku/redis/client/util/RedisSpec.scala index e8a2ef7f..2f859294 100644 --- a/modules/redis-client/src/test/scala/io/renku/redis/client/util/RedisSpec.scala +++ b/modules/redis-client/src/test/scala/io/renku/redis/client/util/RedisSpec.scala @@ -76,5 +76,5 @@ trait RedisSpec: : RedisClient => Resource[IO, RedisCommands[IO, String, String]] = Redis[IO].fromClient(_, RedisCodec.Utf8) - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient) diff --git a/modules/renku-redis-client/src/test/scala/io/renku/queue/client/QueueSpec.scala b/modules/renku-redis-client/src/test/scala/io/renku/queue/client/QueueSpec.scala index 967e0369..53e9c0a1 100644 --- a/modules/renku-redis-client/src/test/scala/io/renku/queue/client/QueueSpec.scala +++ b/modules/renku-redis-client/src/test/scala/io/renku/queue/client/QueueSpec.scala @@ -30,5 +30,5 @@ trait QueueSpec extends RedisSpec: val withQueueClient: QueueFixture = () => withRedisClient.asRedisQueueClient().map(new QueueClientImpl[IO](_)) - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient) diff --git a/modules/search-cli/src/main/scala/io/renku/search/cli/perftests/GitLabDocsCreator.scala b/modules/search-cli/src/main/scala/io/renku/search/cli/perftests/GitLabDocsCreator.scala index 002e3046..5acaa0f5 100644 --- a/modules/search-cli/src/main/scala/io/renku/search/cli/perftests/GitLabDocsCreator.scala +++ b/modules/search-cli/src/main/scala/io/renku/search/cli/perftests/GitLabDocsCreator.scala @@ -99,8 +99,8 @@ private class GitLabDocsCreator[F[_]: Async: ModelTypesGenerators]( .evalMap(getProjectUsers(projectId, _)) .takeWhile(_.nonEmpty) .flatMap(Stream.emits) - .filterNot(_.name contains "_bot_") - .filterNot(_.name contains "****") + .filterNot(_.name `contains` "_bot_") + .filterNot(_.name `contains` "****") .map(toUser) private def getProjectUsers(id: Int, page: Int) = diff --git a/modules/search-provision/src/main/scala/io/renku/search/provision/MessageHandlers.scala b/modules/search-provision/src/main/scala/io/renku/search/provision/MessageHandlers.scala index 38b01901..f515b37b 100644 --- a/modules/search-provision/src/main/scala/io/renku/search/provision/MessageHandlers.scala +++ b/modules/search-provision/src/main/scala/io/renku/search/provision/MessageHandlers.scala @@ -36,8 +36,8 @@ final class MessageHandlers[F[_]: Async]( steps: QueueName => PipelineSteps[F], cfg: QueuesConfig ) extends ShowInstances: - private[this] var tasks: Map[String, F[Unit]] = Map.empty - private[this] def add(queue: QueueName, task: Stream[F, Unit]): Stream[F, Unit] = + private var tasks: Map[String, F[Unit]] = Map.empty + private def add(queue: QueueName, task: Stream[F, Unit]): Stream[F, Unit] = tasks = tasks.updated(queue.name, task.compile.drain) task diff --git a/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/QueueSizeGauge.scala b/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/QueueSizeGauge.scala index e9e789d1..4e91a696 100644 --- a/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/QueueSizeGauge.scala +++ b/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/QueueSizeGauge.scala @@ -23,7 +23,7 @@ import io.renku.redis.client.QueueName private class QueueSizeGauge extends QueueGauge: - private[this] val underlying = + private val underlying = Gauge .build() .name("redis_stream_size") diff --git a/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/UnprocessedCountGauge.scala b/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/UnprocessedCountGauge.scala index b76cace6..4509072b 100644 --- a/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/UnprocessedCountGauge.scala +++ b/modules/search-provision/src/main/scala/io/renku/search/provision/metrics/UnprocessedCountGauge.scala @@ -23,7 +23,7 @@ import io.renku.redis.client.QueueName private class UnprocessedCountGauge extends QueueGauge: - private[this] val underlying = + private val underlying = Gauge .build() .name("redis_stream_unprocessed") diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationAddedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationAddedProvisioningSpec.scala index e3a89a83..8894eb51 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationAddedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationAddedProvisioningSpec.scala @@ -65,7 +65,7 @@ class AuthorizationAddedProvisioningSpec extends ProvisioningSuite: } } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) object AuthorizationAddedProvisioningSpec: diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationRemovedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationRemovedProvisioningSpec.scala index 506e538f..c57296fd 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationRemovedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationRemovedProvisioningSpec.scala @@ -63,7 +63,7 @@ class AuthorizationRemovedProvisioningSpec extends ProvisioningSuite: } } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) object AuthorizationRemovedProvisioningSpec: diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationUpdatedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationUpdatedProvisioningSpec.scala index 7192f407..73ad6eea 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationUpdatedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/AuthorizationUpdatedProvisioningSpec.scala @@ -65,7 +65,7 @@ class AuthorizationUpdatedProvisioningSpec extends ProvisioningSuite: } } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) object AuthorizationUpdatedProvisioningSpec: diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectCreatedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectCreatedProvisioningSpec.scala index 7bff9124..d4e39133 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectCreatedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectCreatedProvisioningSpec.scala @@ -110,7 +110,7 @@ class ProjectCreatedProvisioningSpec extends ProvisioningSuite: yield () } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) object ProjectCreatedProvisioningSpec: diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectRemovedProcessSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectRemovedProcessSpec.scala index 51a8ddfa..6108290e 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectRemovedProcessSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectRemovedProcessSpec.scala @@ -83,5 +83,5 @@ class ProjectRemovedProcessSpec extends ProvisioningSuite: private lazy val queryProjects = Query(typeIs(EntityType.Project)) - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectUpdatedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectUpdatedProvisioningSpec.scala index de39ad8f..6dca7060 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectUpdatedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/project/ProjectUpdatedProvisioningSpec.scala @@ -145,5 +145,5 @@ class ProjectUpdatedProvisioningSpec extends ProvisioningSuite: _.to[ProjectUpdated] ) - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserAddedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserAddedProvisioningSpec.scala index 13be1215..8df6e811 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserAddedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserAddedProvisioningSpec.scala @@ -67,5 +67,5 @@ class UserAddedProvisioningSpec extends ProvisioningSuite: yield () } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserRemovedProcessSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserRemovedProcessSpec.scala index ee37806f..ce43ffd4 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserRemovedProcessSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserRemovedProcessSpec.scala @@ -107,5 +107,5 @@ class UserRemovedProcessSpec extends ProvisioningSuite: yield () } - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserUpdatedProvisioningSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserUpdatedProvisioningSpec.scala index 5a601f4f..13ec5ee1 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserUpdatedProvisioningSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/user/UserUpdatedProvisioningSpec.scala @@ -113,5 +113,5 @@ class UserUpdatedProvisioningSpec extends ProvisioningSuite: ua => UserUpdated(ua.id, ua.firstName, ua.lastName, ua.email) ) - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withRedisClient, withQueueClient, withSearchSolrClient) diff --git a/modules/search-query/src/main/scala/io/renku/search/query/Field.scala b/modules/search-query/src/main/scala/io/renku/search/query/Field.scala index c7b2fb42..a8680ddc 100644 --- a/modules/search-query/src/main/scala/io/renku/search/query/Field.scala +++ b/modules/search-query/src/main/scala/io/renku/search/query/Field.scala @@ -36,7 +36,7 @@ object Field: given Encoder[Field] = Encoder.forString.contramap(_.name) given Decoder[Field] = Decoder.forString.mapEither(fromString) - private[this] val allNames: String = Field.values.map(_.name).mkString(", ") + private val allNames: String = Field.values.map(_.name).mkString(", ") def fromString(str: String): Either[String, Field] = Field.values diff --git a/modules/search-query/src/main/scala/io/renku/search/query/Query.scala b/modules/search-query/src/main/scala/io/renku/search/query/Query.scala index 81973547..b6c01f6e 100644 --- a/modules/search-query/src/main/scala/io/renku/search/query/Query.scala +++ b/modules/search-query/src/main/scala/io/renku/search/query/Query.scala @@ -97,13 +97,13 @@ object Query: Segment.Field(Created(Comparison.GreaterThan, NonEmptyList(date, dates.toList))) def creationDateIs(date: PartialDateTime, dates: PartialDateTime*): Segment = - creationDateIs(DateTimeRef(date), dates.map(DateTimeRef.apply): _*) + creationDateIs(DateTimeRef(date), dates.map(DateTimeRef.apply)*) def creationDateGt(date: PartialDateTime, dates: PartialDateTime*): Segment = - creationDateGt(DateTimeRef(date), dates.map(DateTimeRef.apply): _*) + creationDateGt(DateTimeRef(date), dates.map(DateTimeRef.apply)*) def creationDateLt(date: PartialDateTime, dates: PartialDateTime*): Segment = - creationDateLt(DateTimeRef(date), dates.map(DateTimeRef.apply): _*) + creationDateLt(DateTimeRef(date), dates.map(DateTimeRef.apply)*) val empty: Query = Query(Nil) diff --git a/modules/search-query/src/main/scala/io/renku/search/query/SortableField.scala b/modules/search-query/src/main/scala/io/renku/search/query/SortableField.scala index 8ed18cf5..8eb98497 100644 --- a/modules/search-query/src/main/scala/io/renku/search/query/SortableField.scala +++ b/modules/search-query/src/main/scala/io/renku/search/query/SortableField.scala @@ -33,7 +33,7 @@ object SortableField: given Decoder[SortableField] = Decoder.forString.mapEither(fromString) given Order[SortableField] = Order.by(_.name) - private[this] val allNames: String = SortableField.values.map(_.name).mkString(", ") + private val allNames: String = SortableField.values.map(_.name).mkString(", ") def fromString(str: String): Either[String, SortableField] = SortableField.values diff --git a/modules/search-solr-client/src/main/scala/io/renku/search/solr/client/SearchSolrClientImpl.scala b/modules/search-solr-client/src/main/scala/io/renku/search/solr/client/SearchSolrClientImpl.scala index dff4309e..e0613c0b 100644 --- a/modules/search-solr-client/src/main/scala/io/renku/search/solr/client/SearchSolrClientImpl.scala +++ b/modules/search-solr-client/src/main/scala/io/renku/search/solr/client/SearchSolrClientImpl.scala @@ -37,8 +37,8 @@ import io.renku.solr.client.schema.FieldName private class SearchSolrClientImpl[F[_]: Async](solrClient: SolrClient[F]) extends SearchSolrClient[F]: - private[this] val logger = scribe.cats.effect[F] - private[this] val interpreter = LuceneQueryInterpreter.forSync[F] + private val logger = scribe.cats.effect[F] + private val interpreter = LuceneQueryInterpreter.forSync[F] private val typeTerms = Facet.Terms( EntityDocumentSchema.Fields.entityType, diff --git a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrSortCreate.scala b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrSortCreate.scala index ffa49510..9a543b37 100644 --- a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrSortCreate.scala +++ b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/SolrSortCreate.scala @@ -37,7 +37,7 @@ private object SolrSortCreate: case Order.Direction.Desc => SolrSort.Direction.Desc def apply(ts: Order.OrderedBy*): SolrSort = - SolrSort(ts.map(e => (fromField(e.field), fromDirection(e.direction))): _*) + SolrSort(ts.map(e => (fromField(e.field), fromDirection(e.direction)))*) def apply(ts: NonEmptyList[Order.OrderedBy]): SolrSort = - apply(ts.toList: _*) + apply(ts.toList*) diff --git a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/StringEscape.scala b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/StringEscape.scala index 50618134..06c75e8a 100644 --- a/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/StringEscape.scala +++ b/modules/search-solr-client/src/main/scala/io/renku/search/solr/query/StringEscape.scala @@ -23,7 +23,7 @@ private[query] object StringEscape: // Escapes query characters for solr. This is taken from here: // https://github.com/apache/solr/blob/bcb9f144974ed07aa3b66766302474542067b522/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java#L163 // to not introduce too many dependencies only for this little function - private[this] val defaultSpecialChars = "\\+-!():^[]\"{}~*?|&;/" + private val defaultSpecialChars = "\\+-!():^[]\"{}~*?|&;/" def escape(s: String, specialChars: String): String = inline def isSpecial(c: Char) = c.isWhitespace || specialChars.contains(c) diff --git a/modules/search-solr-client/src/test/scala/io/renku/search/solr/client/SearchSolrSuite.scala b/modules/search-solr-client/src/test/scala/io/renku/search/solr/client/SearchSolrSuite.scala index ae287596..6d3de12b 100644 --- a/modules/search-solr-client/src/test/scala/io/renku/search/solr/client/SearchSolrSuite.scala +++ b/modules/search-solr-client/src/test/scala/io/renku/search/solr/client/SearchSolrSuite.scala @@ -42,5 +42,5 @@ abstract class SearchSolrSuite extends SolrClientBaseSuite: override def afterAll(): Unit = server.stop() - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withSearchSolrClient) diff --git a/modules/search-solr-client/src/test/scala/io/renku/search/solr/query/AuthTestData.scala b/modules/search-solr-client/src/test/scala/io/renku/search/solr/query/AuthTestData.scala index 078cd726..d6af7cf7 100644 --- a/modules/search-solr-client/src/test/scala/io/renku/search/solr/query/AuthTestData.scala +++ b/modules/search-solr-client/src/test/scala/io/renku/search/solr/query/AuthTestData.scala @@ -53,7 +53,7 @@ final case class AuthTestData( copy(projects = projects.updated(key, p)) def queryAll = - Query(Query.Segment.idIs(all.head.id.value, all.tail.map(_.id.value): _*)) + Query(Query.Segment.idIs(all.head.id.value, all.tail.map(_.id.value)*)) def user1EntityIds = users.map(_.id) ++ List( diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteIdRequest.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteIdRequest.scala index 50a102fd..82bb5ad8 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteIdRequest.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteIdRequest.scala @@ -27,7 +27,7 @@ private[client] object DeleteIdRequest: given Encoder[DeleteIdRequest] = new Encoder[DeleteIdRequest]: override def write(w: Writer, value: DeleteIdRequest) = - w.writeMap(Map("delete" -> value.ids.toList))( + w.writeMap(Map("delete" -> value.ids.toList))(using Encoder[String], Encoder[List[String]] ) diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteRequest.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteRequest.scala index 0ecd8522..94a2068d 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteRequest.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/DeleteRequest.scala @@ -28,5 +28,5 @@ private[client] object DeleteRequest: val e: Encoder[DeleteRequest] = deriveEncoder[DeleteRequest] new Encoder[DeleteRequest]: override def write(w: Writer, value: DeleteRequest) = - w.writeMap(Map("delete" -> value))(Encoder[String], e) + w.writeMap(Map("delete" -> value))(using Encoder[String], e) } diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/EncoderSupport.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/EncoderSupport.scala index dc252d08..59af6a22 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/EncoderSupport.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/EncoderSupport.scala @@ -82,7 +82,7 @@ object EncoderSupport { inline def deriveWithAdditional[A <: Product, V: Encoder](field: (String, V)*)(using Mirror.Of[A] ): Encoder[A] = - val adds = AdditionalFields.const[A, V](field: _*) + val adds = AdditionalFields.const[A, V](field*) Macros.createEncoder[String, V, A](adds) private object Macros { @@ -111,7 +111,7 @@ object EncoderSupport { w.writeMapOpen(names.size + additionalProps.size) additionalProps.foreach { case (k, v) => w.writeMapMember(k, v) } names.zip(values).zip(encoders).foreach { case ((k, v), e) => - w.writeMapMember(k, v)(Encoder[String], e.asInstanceOf[Encoder[Any]]) + w.writeMapMember(k, v)(using Encoder[String], e.asInstanceOf[Encoder[Any]]) } w.writeMapClose() @@ -125,7 +125,7 @@ object EncoderSupport { encoders(ord).asInstanceOf[Encoder[Any]].write(w, value) } - inline def summonEncoder[A <: Tuple]: List[Encoder[_]] = + inline def summonEncoder[A <: Tuple]: List[Encoder[?]] = inline erasedValue[A] match case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Encoder[t]] :: summonEncoder[ts] diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/SolrClientImpl.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/SolrClientImpl.scala index 86661b29..42bab3fc 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/SolrClientImpl.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/SolrClientImpl.scala @@ -34,8 +34,8 @@ private class SolrClientImpl[F[_]: Async](config: SolrConfig, underlying: Client with SchemaJsonCodec with BorerEntityJsonCodec with SolrEntityCodec: - private[this] val logger = scribe.cats.effect[F] - private[this] val solrUrl: Uri = config.baseUrl / config.core + private val logger = scribe.cats.effect[F] + private val solrUrl: Uri = config.baseUrl / config.core def modifySchema(cmds: Seq[SchemaCommand], onErrorLog: ResponseLogging): F[Unit] = val req = Method @@ -84,7 +84,7 @@ private class SolrClientImpl[F[_]: Async](config: SolrConfig, underlying: Client override def findById[A: Decoder](id: String, other: String*): F[GetByIdResponse[A]] = val req = Method - .GET(makeGetByIdUrl(NonEmptyList.of(id, other: _*))) + .GET(makeGetByIdUrl(NonEmptyList.of(id, other*))) .withBasicAuth(credentials) underlying.fetchAs[GetByIdResponse[A]](req) diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/migration/SchemaMigrator.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/migration/SchemaMigrator.scala index ef9e68ab..84ef73ff 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/migration/SchemaMigrator.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/migration/SchemaMigrator.scala @@ -42,9 +42,9 @@ object SchemaMigrator: SolrClient[F](solrConfig).map(apply[F]) private class Impl[F[_]: Sync](client: SolrClient[F]) extends SchemaMigrator[F] { - private[this] val logger = scribe.cats.effect[F] - private[this] val versionDocId = "VERSION_ID_EB779C6B-1D96-47CB-B304-BECF15E4A607" - private[this] val versionTypeName: TypeName = TypeName("plong") + private val logger = scribe.cats.effect[F] + private val versionDocId = "VERSION_ID_EB779C6B-1D96-47CB-B304-BECF15E4A607" + private val versionTypeName: TypeName = TypeName("plong") override def currentVersion: F[Option[Long]] = client diff --git a/modules/solr-client/src/main/scala/io/renku/solr/client/schema/SchemaJsonCodec.scala b/modules/solr-client/src/main/scala/io/renku/solr/client/schema/SchemaJsonCodec.scala index 12633b04..f2c2039e 100644 --- a/modules/solr-client/src/main/scala/io/renku/solr/client/schema/SchemaJsonCodec.scala +++ b/modules/solr-client/src/main/scala/io/renku/solr/client/schema/SchemaJsonCodec.scala @@ -67,7 +67,7 @@ trait SchemaJsonCodec { override def write(w: Writer, value: Seq[SchemaCommand]) = w.writeMapOpen(value.size) value.foreach { v => - w.writeMapMember(v.commandName, v)( + w.writeMapMember(v.commandName, v)(using Encoder[String], commandPayloadEncoder ) diff --git a/modules/solr-client/src/test/scala/io/renku/solr/client/SolrClientGenerator.scala b/modules/solr-client/src/test/scala/io/renku/solr/client/SolrClientGenerator.scala index 7a7ccaca..8699f52c 100644 --- a/modules/solr-client/src/test/scala/io/renku/solr/client/SolrClientGenerator.scala +++ b/modules/solr-client/src/test/scala/io/renku/solr/client/SolrClientGenerator.scala @@ -68,5 +68,5 @@ object SolrClientGenerator: val facets: Gen[Facets] = Gen.choose(0, 5).flatMap(n => Gen.listOfN(n, facet)).map { n => if (n.isEmpty) Facets.empty - else Facets(n: _*) + else Facets(n*) } diff --git a/modules/solr-client/src/test/scala/io/renku/solr/client/util/SolrServerSuite.scala b/modules/solr-client/src/test/scala/io/renku/solr/client/util/SolrServerSuite.scala index 941d5d82..9d45f7b4 100644 --- a/modules/solr-client/src/test/scala/io/renku/solr/client/util/SolrServerSuite.scala +++ b/modules/solr-client/src/test/scala/io/renku/solr/client/util/SolrServerSuite.scala @@ -47,5 +47,5 @@ trait SolrServerSuite: override def afterAll(): Unit = server.stop() - override def munitFixtures: Seq[Fixture[_]] = + override def munitFixtures: Seq[Fixture[?]] = List(withSolrClient) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 81a0f8f2..37cd73ef 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -19,6 +19,8 @@ object Dependencies { val http4s = "0.23.26" val http4sPrometheusMetrics = "0.24.6" val redis4Cats = "1.6.0" + val sbtMdoc = "2.5.2" + val scala = "3.4.1" val scalacheckEffectMunit = "1.0.4" val scodec = "2.2.2" val scodecBits = "1.1.38" diff --git a/project/SearchQueryDocsPlugin.scala b/project/SearchQueryDocsPlugin.scala index 0c0659b0..6c8d6e3a 100644 --- a/project/SearchQueryDocsPlugin.scala +++ b/project/SearchQueryDocsPlugin.scala @@ -21,7 +21,8 @@ object SearchQueryDocsPlugin extends AutoPlugin { docDirectory := (Compile / Keys.baseDirectory).value / "docs", outputDirectory := (Compile / Keys.resourceManaged).value / "query-manual", Keys.libraryDependencies ++= Seq( - "org.scalameta" %% "mdoc" % "2.5.2" % Docs + "org.scalameta" %% "mdoc" % Dependencies.V.sbtMdoc % Docs, + "org.scala-lang" %% "scala3-compiler" % Dependencies.V.scala % Docs ), makeManualFile := Def.taskDyn { val cp = (Compile / Keys.dependencyClasspath).value