Skip to content

Commit

Permalink
Update to Scala 2.13.14 (#4946)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Dumas <simon.dumas@epfl.ch>
  • Loading branch information
imsdu and Simon Dumas authored May 7, 2024
1 parent 4bdfa4c commit 46a9e48
Show file tree
Hide file tree
Showing 118 changed files with 47 additions and 359 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ scalafmt: {
}
*/

val scalacScapegoatVersion = "2.1.5"
val scalaCompilerVersion = "2.13.13"
val scalacScapegoatVersion = "2.1.6"
val scalaCompilerVersion = "2.13.14"

val akkaHttpVersion = "10.2.10"
val akkaHttpCirceVersion = "1.39.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import pureconfig.ConfigReader
import pureconfig.error.CannotConvert
import pureconfig.generic.semiauto.deriveReader

import scala.annotation.nowarn

/**
* The service description.
*
Expand All @@ -32,7 +30,7 @@ final case class DescriptionConfig(name: Name, env: Name) {
}

object DescriptionConfig {
@nowarn("cat=unused")

implicit private val nameReader: ConfigReader[Name] =
ConfigReader.fromString(str => Name(str).leftMap(err => CannotConvert(str, "Name", err.getMessage)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import io.circe._
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredDecoder

import scala.annotation.nowarn

class AclsRoutes(identities: Identities, acls: Acls, aclCheck: AclCheck)(implicit
baseUri: BaseUri,
cr: RemoteContextResolution,
Expand Down Expand Up @@ -204,7 +202,6 @@ object AclsRoutes {

private[routes] object AclValues {

@nowarn("cat=unused")
implicit private val identityPermsDecoder: Decoder[IdentityPermissions] = {
implicit val config: Configuration = Configuration.default.withStrictDecoding
deriveConfiguredDecoder[IdentityPermissions]
Expand All @@ -219,7 +216,6 @@ object AclsRoutes {
final private[routes] case class ReplaceAcl(acl: AclValues)
private[routes] object ReplaceAcl {

@nowarn("cat=unused")
implicit val aclReplaceDecoder: Decoder[ReplaceAcl] = {
implicit val config: Configuration = Configuration.default.withStrictDecoding
deriveConfiguredDecoder[ReplaceAcl]
Expand All @@ -231,7 +227,6 @@ object AclsRoutes {
final case class Subtract(acl: AclValues) extends PatchAcl
final case class Append(acl: AclValues) extends PatchAcl

@nowarn("cat=unused")
implicit val aclPatchDecoder: Decoder[PatchAcl] = {
implicit val config: Configuration = Configuration.default.withStrictDecoding.withDiscriminator(keywords.tpe)
deriveConfiguredDecoder[PatchAcl]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredDecoder
import kamon.instrumentation.akka.http.TracingDirectives.operationName

import scala.annotation.nowarn

/**
* The organization routes.
*
Expand Down Expand Up @@ -180,7 +178,7 @@ object OrganizationsRoutes {
final private[routes] case class OrganizationInput(description: Option[String])

private[routes] object OrganizationInput {
@nowarn("cat=unused")

implicit final private val configuration: Configuration = Configuration.default.withStrictDecoding
implicit val organizationDecoder: Decoder[OrganizationInput] = deriveConfiguredDecoder[OrganizationInput]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import io.circe.syntax._
import io.circe.{Decoder, Json}
import kamon.instrumentation.akka.http.TracingDirectives.operationName

import scala.annotation.nowarn

/**
* The permissions routes.
*
Expand Down Expand Up @@ -145,7 +143,6 @@ object PermissionsRoutes {
final case class Subtract(permissions: Set[Permission]) extends PatchPermissions
final case class Replace(permissions: Set[Permission]) extends PatchPermissions

@nowarn("cat=unused")
implicit final private val configuration: Configuration =
Configuration.default.withStrictDecoding.withDiscriminator(keywords.tpe)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import io.circe.Decoder
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredDecoder

import scala.annotation.nowarn

class RealmsRoutes(identities: Identities, realms: Realms, aclCheck: AclCheck)(implicit
baseUri: BaseUri,
paginationConfig: PaginationConfig,
Expand Down Expand Up @@ -119,7 +117,6 @@ class RealmsRoutes(identities: Identities, realms: Realms, aclCheck: AclCheck)(i

object RealmsRoutes {

@nowarn("cat=unused")
implicit final private val configuration: Configuration = Configuration.default.withStrictDecoding

final private[routes] case class RealmInput(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredDecoder
import io.circe.{Decoder, Json}

import scala.annotation.nowarn

/**
* The resource trial routes allowing to do read-only operations on resources
*/
Expand Down Expand Up @@ -134,7 +132,7 @@ object ResourcesTrialRoutes {
final private[routes] case class GenerationInput(schema: SchemaInput = noSchema, resource: NexusSource)

private[routes] object GenerationInput {
@nowarn("cat=unused")

implicit def generationInputDecoder(implicit decodingOption: DecodingOption): Decoder[GenerationInput] = {
implicit val configuration: Configuration = Configuration.default.withDefaults
implicit val nexusSourceDecoder: Decoder[NexusSource] = NexusSource.nexusSourceDecoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef
import io.circe.generic.extras.Configuration
import io.circe.{Encoder, Json, JsonObject}

import scala.annotation.nowarn

/**
* An archive value with its ttl.
*
Expand Down Expand Up @@ -67,7 +65,6 @@ object Archive {
JsonLdEncoder.computeFromCirce(ContextValue(contexts.archivesMetadata))
}

@nowarn("cat=unused")
implicit private def archiveJsonEncoder: Encoder.AsObject[Archive] = {
import io.circe.generic.extras.semiauto._
implicit val cfg: Configuration = Configuration.default.copy(transformMemberNames = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{ProjectRef, ResourceRef}
import io.circe.Encoder

import scala.annotation.nowarn

/**
* Enumeration of archive references.
*/
Expand Down Expand Up @@ -149,7 +147,6 @@ object ArchiveReference {
path: Option[AbsolutePath]
) extends ReferenceInput

@nowarn("cat=unused")
implicit final val referenceInputJsonLdDecoder: JsonLdDecoder[ArchiveReference] = {
def refOf(resourceId: Iri, tag: Option[UserTag], rev: Option[Int]): ResourceRef =
(tag, rev) match {
Expand Down Expand Up @@ -189,7 +186,6 @@ object ArchiveReference {
}
}

@nowarn("cat=unused")
implicit private[model] val archiveReferenceEncoder: Encoder[ArchiveReference] = {
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredCodec

import java.time.Instant
import scala.annotation.nowarn

import scala.concurrent.duration.FiniteDuration

/**
Expand Down Expand Up @@ -61,7 +61,6 @@ final case class ArchiveState(

object ArchiveState {

@nowarn("cat=unused")
implicit val serializer: Serializer[Iri, ArchiveState] = {
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Database._
implicit val configuration: Configuration = Serializer.circeConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.JsonLdDecoderError.Parsi
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.configuration.semiauto.deriveConfigJsonLdDecoder
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.{Configuration, JsonLdDecoder}

import scala.annotation.nowarn

/**
* An archive value.
*
Expand Down Expand Up @@ -67,7 +65,6 @@ object ArchiveValue {

final private case class ArchiveValueInput(resources: NonEmptySet[ArchiveReference])

@nowarn("cat=unused")
implicit final val archiveValueJsonLdDecoder: JsonLdDecoder[ArchiveValue] = {
implicit val cfg: Configuration = Configuration.default
deriveConfigJsonLdDecoder[ArchiveValueInput].flatMap { input =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import io.circe.syntax._
import io.circe.{Encoder, Json, JsonObject}

import java.util.UUID
import scala.annotation.nowarn

/**
* Enumeration of BlazegraphView types
Expand Down Expand Up @@ -155,7 +154,6 @@ object BlazegraphView {
*/
final case class Metadata(uuid: Option[UUID], indexingRev: Option[Int])

@nowarn("cat=unused")
implicit private val blazegraphViewsEncoder: Encoder.AsObject[BlazegraphView] = {
implicit val config: Configuration = Configuration.default.withDiscriminator(keywords.tpe)
Encoder.encodeJsonObject.contramapObject { v =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import io.circe._

import java.time.Instant
import java.util.UUID
import scala.annotation.nowarn

/**
* Enumeration of Blazegraph view events.
Expand Down Expand Up @@ -231,7 +230,6 @@ object BlazegraphViewEvent {
subject: Subject
) extends BlazegraphViewEvent

@nowarn("cat=unused")
val serializer: Serializer[Iri, BlazegraphViewEvent] = {
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Database._
implicit val configuration: Configuration = Serializer.circeConfiguration
Expand Down Expand Up @@ -269,7 +267,6 @@ object BlazegraphViewEvent {

override val selectors: Set[Label] = Set(Label.unsafe("views"), resourcesSelector)

@nowarn("cat=unused")
override val sseEncoder: Encoder.AsObject[BlazegraphViewEvent] = {
val context = ContextValue(Vocabulary.contexts.metadata, contexts.blazegraph)
implicit val config: Configuration = Configuration.default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.circe.{Codec, Json}

import java.time.Instant
import java.util.UUID
import scala.annotation.nowarn

/**
* State for an existing Blazegraph view.
Expand Down Expand Up @@ -115,7 +114,6 @@ final case class BlazegraphViewState(

object BlazegraphViewState {

@nowarn("cat=unused")
implicit val serializer: Serializer[Iri, BlazegraphViewState] = {
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Database._
implicit val configuration: Configuration = Serializer.circeConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import io.circe.generic.extras.semiauto.deriveConfiguredEncoder
import io.circe.syntax._
import io.circe.{Encoder, Json}

import scala.annotation.nowarn

/**
* Enumeration of Blazegraph view values.
*/
Expand Down Expand Up @@ -50,7 +48,6 @@ sealed trait BlazegraphViewValue extends Product with Serializable {
}
}

@nowarn("cat=unused")
object BlazegraphViewValue {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import io.circe.Encoder
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredEncoder

import scala.annotation.nowarn

/**
* Describes the indexing context of a composite view
* @param projectionName
Expand Down Expand Up @@ -45,7 +43,6 @@ object CompositeIndexingDescription {
final case class SparqlSpace(value: String) extends ProjectionSpace
}

@nowarn("cat=unused")
implicit val compositeIndexingDescriptionEncoder: Encoder.AsObject[CompositeIndexingDescription] = {
implicit val configuration: Configuration = Configuration.default.withDiscriminator(keywords.tpe)
implicit val projectionSpaceEncoder: Encoder.AsObject[ProjectionSpace] = deriveConfiguredEncoder[ProjectionSpace]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredCodec

import java.time.Instant
import scala.annotation.nowarn

/**
* Possible restart strategies for a composite view
Expand Down Expand Up @@ -83,7 +82,6 @@ object CompositeRestart {
def auto(viewRef: ViewRef, target: Iri): PartialRebuild = PartialRebuild(viewRef, target, Instant.EPOCH, Anonymous)
}

@nowarn("cat=unused")
implicit val compositeRestartCodec: Codec.AsObject[CompositeRestart] = {
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Database._
implicit val configuration: Configuration = Serializer.circeConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.circe.{Encoder, Json, JsonObject}

import java.time.Instant
import java.util.UUID
import scala.annotation.nowarn

import scala.concurrent.duration.FiniteDuration

/**
Expand Down Expand Up @@ -109,15 +109,14 @@ object CompositeView {
final case class Metadata(uuid: UUID)

object RebuildStrategy {
@nowarn("cat=unused")

implicit final val rebuildStrategyEncoder: Encoder.AsObject[RebuildStrategy] = {
implicit val config: Configuration = Configuration.default.withDiscriminator(keywords.tpe)
implicit val finiteDurationEncoder: Encoder[FiniteDuration] = Encoder.encodeString.contramap(_.toString())
deriveConfiguredEncoder[RebuildStrategy]
}
}

@nowarn("cat=unused")
implicit private def compositeViewEncoder(implicit base: BaseUri): Encoder.AsObject[CompositeView] = {
implicit val config: Configuration = Configuration.default.withDiscriminator(keywords.tpe)
import ch.epfl.bluebrain.nexus.delta.sdk.circe.nonEmptyMap._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import io.circe.{Codec, Decoder, Encoder, Json, JsonObject}

import java.time.Instant
import java.util.UUID
import scala.annotation.nowarn

/**
* Composite view event enumeration.
Expand Down Expand Up @@ -193,7 +192,6 @@ object CompositeViewEvent {
subject: Subject
) extends CompositeViewEvent

@nowarn("cat=unused")
val serializer: Serializer[Iri, CompositeViewEvent] = {
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Database._
implicit val configuration: Configuration = Serializer.circeConfiguration
Expand Down Expand Up @@ -232,7 +230,6 @@ object CompositeViewEvent {

override val selectors: Set[Label] = Set(Label.unsafe("views"), resourcesSelector)

@nowarn("cat=unused")
override val sseEncoder: Encoder.AsObject[CompositeViewEvent] = {
val context = ContextValue(Vocabulary.contexts.metadata, contexts.compositeViews)
implicit val config: Configuration = Configuration.default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri
import io.circe.syntax.EncoderOps
import io.circe.{Encoder, Json}

import scala.annotation.nowarn
import scala.concurrent.duration.FiniteDuration

/**
Expand Down Expand Up @@ -49,15 +48,13 @@ object CompositeViewFields {
): CompositeViewFields =
CompositeViewFields(None, None, sources, projections, rebuildStrategy)

@nowarn("cat=unused")
implicit final def compositeViewFieldsEncoder(implicit base: BaseUri): Encoder.AsObject[CompositeViewFields] = {
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto._
implicit val config: Configuration = Configuration.default
deriveConfiguredEncoder[CompositeViewFields]
}

@nowarn("cat=unused")
final def jsonLdDecoder(minIntervalRebuild: FiniteDuration): JsonLdDecoder[CompositeViewFields] = {
implicit val rebuildStrategyDecoder: JsonLdDecoder[RebuildStrategy] = {
implicit val scopedFiniteDurationDecoder: JsonLdDecoder[FiniteDuration] =
Expand Down
Loading

0 comments on commit 46a9e48

Please sign in to comment.