Fix compile warnings after scala update

This commit is contained in:
eikek
2024-03-03 18:43:54 +01:00
parent 3e76385d08
commit 924aaf720e
79 changed files with 383 additions and 256 deletions

View File

@ -43,8 +43,11 @@ object MigrateDueItemTasks extends TransactorSupport with JsonCodecs {
)
_ <- tasks2.traverse(migratePeriodicDueItemsTask)
_ <- tasks3.traverse(migratePeriodicQueryTask)
_ <- RPeriodicTask.setEnabledByTask(PeriodicQueryArgsOld.taskName, false)
_ <- RPeriodicTask.setEnabledByTask(PeriodicDueItemsArgsOld.taskName, false)
_ <- RPeriodicTask.setEnabledByTask(PeriodicQueryArgsOld.taskName, enabled = false)
_ <- RPeriodicTask.setEnabledByTask(
PeriodicDueItemsArgsOld.taskName,
enabled = false
)
} yield ()
private def migratePeriodicQueryTask(old: RPeriodicTask): ConnectionIO[Int] =

View File

@ -38,7 +38,7 @@ object MigrateNotifyTasks extends TransactorSupport {
logger.info(s"Starting to migrate ${tasks.size} user tasks")
)
_ <- tasks.traverse(migrateDueItemTask1)
_ <- RPeriodicTask.setEnabledByTask(NotifyDueItemsArgs.taskName, false)
_ <- RPeriodicTask.setEnabledByTask(NotifyDueItemsArgs.taskName, enabled = false)
} yield ()
private def migrateDueItemTask1(old: RPeriodicTask): ConnectionIO[Int] = {

View File

@ -13,5 +13,9 @@ case class SchemaMigrateConfig(
)
object SchemaMigrateConfig {
val defaults = SchemaMigrateConfig(true, true, false)
val defaults = SchemaMigrateConfig(
runMainMigrations = true,
runFixupMigrations = true,
repairSchema = false
)
}

View File

@ -25,7 +25,7 @@ object FileUrlReader {
authority = Some(""),
path = LenientUri.NonEmptyPath(
Nel.of(key.collective.valueAsString, key.category.id.id, key.id.id),
false
trailingSlash = false
),
query = None,
fragment = None

View File

@ -15,7 +15,7 @@ object DBFunction {
val countAll: DBFunction = CountAll
def countAs[A](column: Column[A]): DBFunction =
Count(column, false)
Count(column, distinct = false)
case object CountAll extends DBFunction

View File

@ -78,10 +78,10 @@ trait DSL extends DoobieMeta {
FromExpr.From(sel, alias)
def count(c: Column[_]): DBFunction =
DBFunction.Count(c, false)
DBFunction.Count(c, distinct = false)
def countDistinct(c: Column[_]): DBFunction =
DBFunction.Count(c, true)
DBFunction.Count(c, distinct = true)
def countAll: DBFunction =
DBFunction.CountAll
@ -250,22 +250,22 @@ trait DSL extends DoobieMeta {
in(subsel).negate
def in(values: Nel[A])(implicit P: Put[A]): Condition =
Condition.InValues(col.s, values, false)
Condition.InValues(col.s, values, lower = false)
def notIn(values: Nel[A])(implicit P: Put[A]): Condition =
in(values).negate
def inLower(values: Nel[String]): Condition =
Condition.InValues(col.s, values.map(_.toLowerCase), true)
Condition.InValues(col.s, values.map(_.toLowerCase), lower = true)
def inLowerA(values: Nel[A])(implicit P: Put[A]): Condition =
Condition.InValues(col.s, values, true)
Condition.InValues(col.s, values, lower = true)
def notInLower(values: Nel[String]): Condition =
Condition.InValues(col.s, values.map(_.toLowerCase), true).negate
Condition.InValues(col.s, values.map(_.toLowerCase), lower = true).negate
def notInLowerA(values: Nel[A])(implicit P: Put[A]): Condition =
Condition.InValues(col.s, values, true).negate
Condition.InValues(col.s, values, lower = true).negate
def isNull: Condition =
Condition.IsNull(col.s)
@ -382,7 +382,7 @@ trait DSL extends DoobieMeta {
Condition.CompareFVal(sel, Operator.Neq, value)
def in[A](values: Nel[A])(implicit P: Put[A]): Condition =
Condition.InValues(sel, values, false)
Condition.InValues(sel, values, lower = false)
}
}

View File

@ -76,32 +76,38 @@ sealed trait Select {
object Select {
def apply(projection: SelectExpr) =
SimpleSelect(false, Nel.of(projection), None, Condition.unit, None)
SimpleSelect(distinctFlag = false, Nel.of(projection), None, Condition.unit, None)
def apply(projection: Nel[SelectExpr], from: FromExpr) =
SimpleSelect(false, projection, from.some, Condition.unit, None)
SimpleSelect(distinctFlag = false, projection, from.some, Condition.unit, None)
def apply(projection: SelectExpr, from: FromExpr) =
SimpleSelect(false, Nel.of(projection), from.some, Condition.unit, None)
SimpleSelect(
distinctFlag = false,
Nel.of(projection),
from.some,
Condition.unit,
None
)
def apply(
projection: Nel[SelectExpr],
from: FromExpr,
where: Condition
) = SimpleSelect(false, projection, from.some, where, None)
) = SimpleSelect(distinctFlag = false, projection, from.some, where, None)
def apply(
projection: SelectExpr,
from: FromExpr,
where: Condition
) = SimpleSelect(false, Nel.of(projection), from.some, where, None)
) = SimpleSelect(distinctFlag = false, Nel.of(projection), from.some, where, None)
def apply(
projection: Nel[SelectExpr],
from: FromExpr,
where: Condition,
groupBy: GroupBy
) = SimpleSelect(false, projection, from.some, where, Some(groupBy))
) = SimpleSelect(distinctFlag = false, projection, from.some, where, Some(groupBy))
case class SimpleSelect(
distinctFlag: Boolean,

View File

@ -46,7 +46,7 @@ object RCollective {
collName,
CollectiveState.Active,
Language.German,
true,
integrationEnabled = true,
created
)

View File

@ -180,8 +180,8 @@ object RTag {
.sortBy(_._1)
byCat match {
case (None, tags) :: rest =>
rest.flatMap(_._2) ++ tags
case (None, tagsByCat) :: rest =>
rest.flatMap(_._2) ++ tagsByCat
case _ =>
byCat.flatMap(_._2)
}

View File

@ -44,7 +44,7 @@ object RTotp {
for {
now <- Timestamp.current[F]
key <- Key.generate[F](mac)
} yield RTotp(userId, false, key, now)
} yield RTotp(userId, enabled = false, key, now)
def insert(r: RTotp): ConnectionIO[Int] =
DML.insert(T, T.all, sql"${r.userId},${r.enabled},${r.secret},${r.created}")

View File

@ -199,10 +199,10 @@ object RUserEmail {
userId: Ident,
nameQ: Option[String]
): ConnectionIO[Vector[RUserEmail]] =
findByAccount0(userId, nameQ, false).to[Vector]
findByAccount0(userId, nameQ, exact = false).to[Vector]
def getByName(userId: Ident, name: Ident): ConnectionIO[Option[RUserEmail]] =
findByAccount0(userId, Some(name.id), true).option
findByAccount0(userId, Some(name.id), exact = true).option
def getById(id: Ident): ConnectionIO[Option[RUserEmail]] = {
val t = Table(None)

View File

@ -195,13 +195,13 @@ object RUserImap {
userId: Ident,
nameQ: Option[String]
): ConnectionIO[Vector[RUserImap]] =
findByAccount0(userId, nameQ, false).to[Vector]
findByAccount0(userId, nameQ, exact = false).to[Vector]
def getByName(
userId: Ident,
name: Ident
): ConnectionIO[Option[RUserImap]] =
findByAccount0(userId, Some(name.id), true).option
findByAccount0(userId, Some(name.id), exact = true).option
def delete(
userId: Ident,

View File

@ -106,7 +106,7 @@ object StoreFixture {
for {
xa <- makeXA(ds)
cfg = FileRepositoryConfig.Database(64 * 1024)
fr = FileRepository[IO](xa, ds, cfg, true)
fr = FileRepository[IO](xa, ds, cfg, withAttributeStore = true)
store = new StoreImpl[IO](fr, jdbc, schemaMigrateConfig, ds, xa)
_ <- Resource.eval(store.migrate)
} yield store

View File

@ -193,7 +193,7 @@ class TempFtsOpsTest extends DatabaseTest {
DocspellSystem.account.collective,
CollectiveState.Active,
Language.English,
true,
integrationEnabled = true,
ts
)

View File

@ -39,7 +39,7 @@ class QueryBuilderTest extends FunSuite with TestLoggingConfig {
val q = Select(proj, tables, cond).orderBy(c.name.desc)
q match {
case Select.Ordered(
Select.SimpleSelect(false, proj, from, where, group),
Select.SimpleSelect(false, projs, from, where, group),
sb,
vempty
) =>
@ -48,7 +48,7 @@ class QueryBuilderTest extends FunSuite with TestLoggingConfig {
sb,
OrderBy(SelectExpr.SelectColumn(c.name, None), OrderBy.OrderType.Desc)
)
assertEquals(11, proj.size)
assertEquals(11, projs.size)
from match {
case None =>
fail("Unexpected from value")