Skip to content

Commit

Permalink
Merge pull request #265 from SwissDataScienceCenter/update/scalafmt-c…
Browse files Browse the repository at this point in the history
…ore-3.8.4

chore: Update scalafmt-core from 3.8.3 to 3.8.4
  • Loading branch information
mergify[bot] authored Jan 13, 2025
2 parents decf98f + a28f5ce commit 6e05bf6
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 38 deletions.
4 changes: 3 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
9cc3dd838b39afa97ddb76987d070f35f9bd36b8

# eikek: remove header from all sources
eefe534f36aceb8b9b73176d968fb9eaff2a71d7
eefe534f36aceb8b9b73176d968fb9eaff2a71d7
# Scala Steward: Reformat with scalafmt 3.8.4
d69f2b9ad270b60b31fb1be20913f7b3fde799f4
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"

preset = default
align.preset = some
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ object EventsGenerators:
Gen.listOfN(1, plgen).flatMap { pl =>
val schema = pl.head.schema
val mt = pl.head.msgType
eventMessageGen(schema, mt, Gen.const(pl)).map(msg =>
msg.copy(header = msg.header.withSchemaVersion(pl.head.version.head))
)
eventMessageGen(schema, mt, Gen.const(pl))
.map(msg => msg.copy(header = msg.header.withSchemaVersion(pl.head.version.head)))
}

def v1ProjectCreatedGen(prefix: String): Gen[v1.ProjectCreated] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ object JwtVerify:
def verify(token: String): F[Either[JwtError, RenkuToken]] =
Applicative[F].pure(result match
case a: JwtError => Left(a)
case b: RenkuToken => Right(b)
)
case b: RenkuToken => Right(b))
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object Authenticate:
case AuthToken.AnonymousId(id) =>
Right(AuthContext.anonymousId(id.value)).pure[F]
case AuthToken.JwtToken(token) =>
EitherT(verify.verify(token).map(ClaimToContext.from)).leftSemiflatMap {
err => logger.warn(err.sanitized, err.cause).as(err.sanitized)
EitherT(verify.verify(token).map(ClaimToContext.from)).leftSemiflatMap { err =>
logger.warn(err.sanitized, err.cause).as(err.sanitized)
}.value
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private object RedisConfigOpts:
private val refreshInterval: Opts[FiniteDuration] =
Opts
.option[FiniteDuration]("redis-connection-refresh", "Redis connection refresh")
.withDefault(1 hour)
.withDefault(1.hour)

val configOpts: Opts[RedisConfig] =
(host, port, sentinel, db.map(Option(_)), password, masterSet, refreshInterval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ object DocumentMerger:
}

given DocumentMerger[ProjectMemberAdded] =
instance[ProjectMemberAdded](_.toModel(DocVersion.NotExists).some) {
(paa, existing) =>
existing match
case p: PartialEntityDocument.Project =>
p.modifyEntityMembers(_.addMember(paa.userId, paa.role)).some
case p: ProjectDocument =>
p.modifyEntityMembers(_.addMember(paa.userId, paa.role)).some
case _: PartialEntityDocument.Group | _: GroupDocument | _: UserDocument => None
instance[ProjectMemberAdded](_.toModel(DocVersion.NotExists).some) { (paa, existing) =>
existing match
case p: PartialEntityDocument.Project =>
p.modifyEntityMembers(_.addMember(paa.userId, paa.role)).some
case p: ProjectDocument =>
p.modifyEntityMembers(_.addMember(paa.userId, paa.role)).some
case _: PartialEntityDocument.Group | _: GroupDocument | _: UserDocument => None
}

given DocumentMerger[ProjectMemberUpdated] =
Expand Down Expand Up @@ -127,15 +126,14 @@ object DocumentMerger:
}

given DocumentMerger[GroupMemberUpdated] =
instance[GroupMemberUpdated](_.toModel(DocVersion.NotExists).some) {
(gmu, existing) =>
existing match
case g: PartialEntityDocument.Group =>
g.modifyEntityMembers(_.addMember(gmu.userId, gmu.role)).some
case g: GroupDocument =>
g.modifyEntityMembers(_.addMember(gmu.userId, gmu.role)).some
case _: PartialEntityDocument.Project | _: UserDocument | _: ProjectDocument =>
None
instance[GroupMemberUpdated](_.toModel(DocVersion.NotExists).some) { (gmu, existing) =>
existing match
case g: PartialEntityDocument.Group =>
g.modifyEntityMembers(_.addMember(gmu.userId, gmu.role)).some
case g: GroupDocument =>
g.modifyEntityMembers(_.addMember(gmu.userId, gmu.role)).some
case _: PartialEntityDocument.Project | _: UserDocument | _: ProjectDocument =>
None
}

given DocumentMerger[GroupMemberRemoved] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import io.renku.solr.client.{QueryData, QueryString}
trait FetchFromSolr[F[_]]:
def fetchEntityForUser(userId: Id): Stream[F, EntityId]
def loadProjectsByGroup[A](msg: EntityOrPartialMessage[A]): F[EntityOrPartialMessage[A]]
def loadEntityOrPartial[A](using IdExtractor[A])(
def loadEntityOrPartial[A](using
IdExtractor[A]
)(
msg: EventMessage[A]
): F[EntityOrPartialMessage[A]]
def loadProjectGroups(
Expand Down Expand Up @@ -89,7 +91,9 @@ object FetchFromSolr:
QueryData(query).withFields(EntityDocumentSchema.Fields.id)
)

def loadEntityOrPartial[A](using IdExtractor[A])(
def loadEntityOrPartial[A](using
IdExtractor[A]
)(
msg: EventMessage[A]
): F[EntityOrPartialMessage[A]] =
val loaded =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final case class QueryData(
def withCursor(cursorMark: CursorMark): QueryData =
copy(params = params.updated("cursorMark", cursorMark.render))

/** When using a cursor, it is required to add a `uniqueKey`field to the sort clause to
/** When using a cursor, it is required to add a `uniqueKey` field to the sort clause to
* guarantee a deterministic order.
*/
def withCursor(cursorMark: CursorMark, keyField: FieldName): QueryData =
Expand Down
8 changes: 3 additions & 5 deletions project/AvroCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ object AvroCodeGen extends AutoPlugin {

def avroHuggerSettings = Seq(
libraryDependencies ++= Dependencies.avro,
Compile / avroScalaCustomTypes := {
Compile / avroScalaCustomTypes :=
avrohugger.format.SpecificRecord.defaultTypes.copy(
record = avrohugger.types.ScalaCaseClassWithSchema
)
},
Compile / avroScalaSpecificCustomTypes := {
),
Compile / avroScalaSpecificCustomTypes :=
avrohugger.format.SpecificRecord.defaultTypes.copy(
record = avrohugger.types.ScalaCaseClassWithSchema
)
}
)

override def projectSettings = avroHuggerSettings ++ Seq(
Expand Down
5 changes: 2 additions & 3 deletions project/DbTestPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object DbTestPlugin extends AutoPlugin {
override def trigger = PluginTrigger.AllRequirements

override def projectSettings: Seq[Def.Setting[_]] = Seq(
Test / dbTests := {
Test / dbTests :=
Def
.sequential(
Def.task {
Expand All @@ -36,8 +36,7 @@ object DbTestPlugin extends AutoPlugin {
RedisServer.forceStop()
}
)
.value
},
.value,
// We need to disable running the `dbTests` on all aggregates,
// otherwise it would try starting/stopping servers again and
// again. The `all(ScopeFilter(inAggregates(ThisProject)))` makes
Expand Down

0 comments on commit 6e05bf6

Please sign in to comment.