Skip to content

Commit

Permalink
Merge pull request #2913 from eikek/update/scalafmt-core-3.8.4
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.8.4
  • Loading branch information
mergify[bot] authored Jan 13, 2025
2 parents 671dc11 + b8fe48b commit 7a51bab
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.8.2
1c566cd5182d41f4cc06040fc347ddb4be617779

# Scala Steward: Reformat with scalafmt 3.8.4
f90502399d78e7a3eb07bd7a1d130e6ae9ba498c
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.2"
version = "3.8.4"

preset = default
align.preset = some
Expand Down
5 changes: 2 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions modules/files/src/main/scala/docspell/files/ImageSize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions modules/totp/src/main/scala/docspell/totp/Totp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 2 additions & 3 deletions project/NerModelsPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit 7a51bab

Please sign in to comment.