From 9ab66ba97985f1620d6a4b09fbf6b9978aa476f9 Mon Sep 17 00:00:00 2001 From: eikek-scala-steward Date: Mon, 13 Jan 2025 06:15:34 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 151f8450e..ec828ee18 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.2" +version = "3.8.4" preset = default align.preset = some From f90502399d78e7a3eb07bd7a1d130e6ae9ba498c Mon Sep 17 00:00:00 2001 From: eikek-scala-steward Date: Mon, 13 Jan 2025 06:15:53 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.4 Executed command: scalafmt --non-interactive --- build.sbt | 5 ++--- .../main/scala/docspell/backend/ops/ODownloadAll.scala | 3 +-- .../files/src/main/scala/docspell/files/ImageSize.scala | 9 +++------ .../src/main/scala/docspell/ftsclient/FtsClient.scala | 2 +- .../main/scala/docspell/joex/process/ConvertPdf.scala | 2 +- .../main/scala/docspell/joex/process/EvalProposals.scala | 3 +-- .../scala/docspell/joex/updatecheck/UpdateCheck.scala | 3 +-- .../main/scala/docspell/restserver/Subscriptions.scala | 3 +-- .../docspell/scheduler/usertask/UserTaskStore.scala | 2 +- .../src/main/scala/docspell/store/queries/QLogin.scala | 3 +-- modules/totp/src/main/scala/docspell/totp/Totp.scala | 3 +-- project/NerModelsPlugin.scala | 5 ++--- 12 files changed, 16 insertions(+), 27 deletions(-) diff --git a/build.sbt b/build.sbt index 04556cb74..904cd0ae0 100644 --- a/build.sbt +++ b/build.sbt @@ -1108,9 +1108,8 @@ def createWebjarSource(wj: Seq[ModuleID], out: File): Seq[File] = { val badChars = "-.".toSet val fields = wj .map(m => - s"""val ${m.name.toLowerCase.filter(c => - !badChars.contains(c) - )} = "/${m.name}/${m.revision}" """ + s"""val ${m.name.toLowerCase + .filter(c => !badChars.contains(c))} = "/${m.name}/${m.revision}" """ ) .mkString("\n\n") val content = s"""package docspell.restserver.webapp diff --git a/modules/backend/src/main/scala/docspell/backend/ops/ODownloadAll.scala b/modules/backend/src/main/scala/docspell/backend/ops/ODownloadAll.scala index 98d070dbe..99c567742 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/ODownloadAll.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/ODownloadAll.scala @@ -33,8 +33,7 @@ import scodec.bits.ByteVector trait ODownloadAll[F[_]] { - /** Calculates what kind of zip file would be created and checks the server thresholds. - */ + /** Calculates what kind of zip file would be created and checks the server thresholds. */ def getSummary(account: AccountInfo, req: DownloadRequest): F[DownloadSummary] /** Same as `getSummary` but also submits the job to really create the zip file if diff --git a/modules/files/src/main/scala/docspell/files/ImageSize.scala b/modules/files/src/main/scala/docspell/files/ImageSize.scala index a671067ce..e73d8dbb9 100644 --- a/modules/files/src/main/scala/docspell/files/ImageSize.scala +++ b/modules/files/src/main/scala/docspell/files/ImageSize.scala @@ -20,18 +20,15 @@ import fs2.io.file.Path object ImageSize { - /** Return the image size from its header without reading the whole image into memory. - */ + /** Return the image size from its header without reading the whole image into memory. */ def get(file: Path): Option[Dimension] = Using(new FileImageInputStream(file.toNioPath.toFile))(getDimension).toOption.flatten - /** Return the image size from its header without reading the whole image into memory. - */ + /** Return the image size from its header without reading the whole image into memory. */ def get(in: InputStream): Option[Dimension] = Option(ImageIO.createImageInputStream(in)).flatMap(getDimension) - /** Return the image size from its header without reading the whole image into memory. - */ + /** Return the image size from its header without reading the whole image into memory. */ def get[F[_]: Sync](data: Stream[F, Byte]): F[Option[Dimension]] = data.take(768).compile.to(Array).map { ar => val iis = ImageIO.createImageInputStream(new ByteArrayInputStream(ar)) diff --git a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala index 400eefe7e..41bab53d6 100644 --- a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala +++ b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala @@ -48,7 +48,7 @@ trait FtsClient[F[_]] { else Stream.emit(result) ++ searchAll(q.nextPage) } - /** Push all data to the index. Data with same `id' is replaced. Values that are `None' + /** Push all data to the index. Data with same `id' is replaced. Values that are ` None' * are removed from the index (or set to an empty string). */ def indexData(logger: Logger[F], data: Stream[F, TextData]): F[Unit] diff --git a/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala b/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala index 6066c9fa6..01e240727 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala @@ -28,7 +28,7 @@ import docspell.store.records._ * been stored in the `attachment_source` record. * * If pdf conversion is not possible or if the input is already a pdf, both files are - * identical. That is, the `file_id`s point to the same file. Since the name of an + * identical. That is, the `file_id` s point to the same file. Since the name of an * attachment may be changed by the user, the `attachment_origin` record keeps that, too. * * This step assumes an existing premature item, it traverses its attachments. diff --git a/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala b/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala index 521aeb5b2..92d4d0130 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala @@ -16,8 +16,7 @@ import docspell.scheduler.Task import docspell.store.Store import docspell.store.records.{RAttachmentMeta, RPerson} -/** Calculate weights for candidates that adds the most likely candidate a lower number. - */ +/** Calculate weights for candidates that adds the most likely candidate a lower number. */ object EvalProposals { def apply[F[_]: Sync]( diff --git a/modules/joex/src/main/scala/docspell/joex/updatecheck/UpdateCheck.scala b/modules/joex/src/main/scala/docspell/joex/updatecheck/UpdateCheck.scala index 449420f11..3ea5d2f7d 100644 --- a/modules/joex/src/main/scala/docspell/joex/updatecheck/UpdateCheck.scala +++ b/modules/joex/src/main/scala/docspell/joex/updatecheck/UpdateCheck.scala @@ -33,8 +33,7 @@ object UpdateCheck { def version: String = tag_name.replaceFirst("v", "") - /** Checks if `thisVersion` is either a SNAPSHOT version or the same as this release. - */ + /** Checks if `thisVersion` is either a SNAPSHOT version or the same as this release. */ def matchesVersion(tv: ThisVersion): Boolean = { val myVersion = tv.get myVersion.endsWith("SNAPSHOT") || myVersion == version diff --git a/modules/restserver/src/main/scala/docspell/restserver/Subscriptions.scala b/modules/restserver/src/main/scala/docspell/restserver/Subscriptions.scala index ced60b68e..9891e05c2 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/Subscriptions.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/Subscriptions.scala @@ -16,8 +16,7 @@ import docspell.scheduler.msg.{JobDone, JobSubmitted} import io.circe.parser -/** Subscribes to those events from docspell that are forwarded to the websocket endpoints - */ +/** Subscribes to those events from docspell that are forwarded to the websocket endpoints */ object Subscriptions { def apply[F[_]: Async]( diff --git a/modules/scheduler/api/src/main/scala/docspell/scheduler/usertask/UserTaskStore.scala b/modules/scheduler/api/src/main/scala/docspell/scheduler/usertask/UserTaskStore.scala index 8d8b594db..d6e24dc8a 100644 --- a/modules/scheduler/api/src/main/scala/docspell/scheduler/usertask/UserTaskStore.scala +++ b/modules/scheduler/api/src/main/scala/docspell/scheduler/usertask/UserTaskStore.scala @@ -13,7 +13,7 @@ import docspell.common._ import io.circe._ -/** User tasks are `RPeriodicTask`s that can be managed by the user. The user can change +/** User tasks are `RPeriodicTask` s that can be managed by the user. The user can change * arguments, enable/disable it or run it just once. * * This class defines methods at a higher level, dealing with `UserTask` and diff --git a/modules/store/src/main/scala/docspell/store/queries/QLogin.scala b/modules/store/src/main/scala/docspell/store/queries/QLogin.scala index 7bbc7128f..86b75cdc0 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QLogin.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QLogin.scala @@ -58,8 +58,7 @@ object QLogin { def findUser(userId: Ident): ConnectionIO[Option[Data]] = findUser0((user, _) => user.uid === userId) - /** Finds the account given a combination of login/user-id and coll-id/coll-name pair. - */ + /** Finds the account given a combination of login/user-id and coll-id/coll-name pair. */ def findAccount(acc: AccountId): ConnectionIO[Option[AccountInfo]] = { // collective may be given as id or name and it is possible to have two collective // ids given. In that (not so nice) case, we need to lookup the collective name and diff --git a/modules/totp/src/main/scala/docspell/totp/Totp.scala b/modules/totp/src/main/scala/docspell/totp/Totp.scala index 27b42812d..0e2a12975 100644 --- a/modules/totp/src/main/scala/docspell/totp/Totp.scala +++ b/modules/totp/src/main/scala/docspell/totp/Totp.scala @@ -21,8 +21,7 @@ trait Totp { /** Generate the password for the given key and time. */ def generate(key: Key, time: Instant): OnetimePassword - /** Generate a stream of passwords using the given key and starting at the given time. - */ + /** Generate a stream of passwords using the given key and starting at the given time. */ def generateStream[F[_]](key: Key, time: Instant): Stream[F, OnetimePassword] /** Checks whether the given password matches using the current time. */ diff --git a/project/NerModelsPlugin.scala b/project/NerModelsPlugin.scala index f2cae44aa..eb524e3d3 100644 --- a/project/NerModelsPlugin.scala +++ b/project/NerModelsPlugin.scala @@ -29,14 +29,13 @@ object NerModelsPlugin extends AutoPlugin { def nerModelSettings: Seq[Setting[_]] = Seq( nerModelsFilter := (_ => false), - nerModelsRunFilter := { + nerModelsRunFilter := filterArtifacts( streams.value.log, Classpaths.managedJars(NerModels, Set("jar", "zip"), update.value), nerModelsFilter.value, (Compile / resourceManaged).value - ) - }, + ), Compile / resourceGenerators += nerModelsRunFilter.taskValue ) From b8fe48babeb1241aa92d14b4832a4d8b4e78becf Mon Sep 17 00:00:00 2001 From: eikek-scala-steward Date: Mon, 13 Jan 2025 06:15:53 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.4' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index e16d53824..c04278c63 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.8.2 1c566cd5182d41f4cc06040fc347ddb4be617779 + +# Scala Steward: Reformat with scalafmt 3.8.4 +f90502399d78e7a3eb07bd7a1d130e6ae9ba498c