mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-05-31 04:22:52 +00:00
Update scalafmt settings
This commit is contained in:
parent
c37f1d7c31
commit
9013f2de5b
@ -1,6 +1,7 @@
|
||||
version = "3.0.4"
|
||||
|
||||
preset = defaultWithAlign
|
||||
preset = default
|
||||
align.preset = some
|
||||
|
||||
maxColumn = 90
|
||||
|
||||
@ -12,3 +13,10 @@ rewrite.rules = [
|
||||
PreferCurlyFors
|
||||
SortModifiers
|
||||
]
|
||||
|
||||
assumeStandardLibraryStripMargin = true
|
||||
align.stripMargin = true
|
||||
|
||||
docstrings.style = SpaceAsterisk
|
||||
docstrings.oneline = fold
|
||||
docstrings.wrap = "yes"
|
@ -14,8 +14,7 @@ private[analysis] object Tld {
|
||||
def endsWithTld(str: String): Boolean =
|
||||
findTld(str).isDefined
|
||||
|
||||
/** Some selected TLDs.
|
||||
*/
|
||||
/** Some selected TLDs. */
|
||||
private[this] val known = List(
|
||||
".com",
|
||||
".org",
|
||||
|
@ -8,8 +8,7 @@ package docspell.analysis.split
|
||||
|
||||
import fs2.Stream
|
||||
|
||||
/** Splits text into words.
|
||||
*/
|
||||
/** Splits text into words. */
|
||||
object TextSplitter {
|
||||
private[this] val trimChars =
|
||||
".,…_[]^!<>=&ſ/{}*?()-:#$|~`+%\\\"'; \t\r\n".toSet
|
||||
|
@ -49,8 +49,7 @@ trait OFulltext[F[_]] {
|
||||
def findIndexOnlySummary(account: AccountId, fts: OFulltext.FtsInput): F[SearchSummary]
|
||||
def findItemsSummary(q: Query, fts: OFulltext.FtsInput): F[SearchSummary]
|
||||
|
||||
/** Clears the full-text index completely and launches a task that indexes all data.
|
||||
*/
|
||||
/** Clears the full-text index completely and launches a task that indexes all data. */
|
||||
def reindexAll: F[Unit]
|
||||
|
||||
/** Clears the full-text index for the given collective and starts a task indexing all
|
||||
|
@ -188,23 +188,20 @@ trait OItem[F[_]] {
|
||||
notifyJoex: Boolean
|
||||
): F[UpdateResult]
|
||||
|
||||
/** Submits a task that (re)generates the preview image for an attachment.
|
||||
*/
|
||||
/** Submits a task that (re)generates the preview image for an attachment. */
|
||||
def generatePreview(
|
||||
args: MakePreviewArgs,
|
||||
account: AccountId,
|
||||
notifyJoex: Boolean
|
||||
): F[UpdateResult]
|
||||
|
||||
/** Submits a task that (re)generates the preview images for all attachments.
|
||||
*/
|
||||
/** Submits a task that (re)generates the preview images for all attachments. */
|
||||
def generateAllPreviews(
|
||||
storeMode: MakePreviewArgs.StoreMode,
|
||||
notifyJoex: Boolean
|
||||
): F[UpdateResult]
|
||||
|
||||
/** Merges a list of items into one item. The remaining items are deleted.
|
||||
*/
|
||||
/** Merges a list of items into one item. The remaining items are deleted. */
|
||||
def merge(
|
||||
logger: Logger[F],
|
||||
items: NonEmptyList[Ident],
|
||||
|
@ -48,8 +48,7 @@ trait OSimpleSearch[F[_]] {
|
||||
): F[StringSearchResult[Items]] =
|
||||
OSimpleSearch.applySearch[F, Items](fix, q)((iq, fts) => search(settings)(iq, fts))
|
||||
|
||||
/** Same as `searchByString` but returning a summary instead of the results.
|
||||
*/
|
||||
/** Same as `searchByString` but returning a summary instead of the results. */
|
||||
final def searchSummaryByString(
|
||||
settings: StatsSettings
|
||||
)(fix: Query.Fix, q: ItemQueryString)(implicit
|
||||
|
@ -29,8 +29,7 @@ trait OTag[F[_]] {
|
||||
|
||||
def delete(id: Ident, collective: Ident): F[AddResult]
|
||||
|
||||
/** Load all tags given their ids. Ids that are not available are ignored.
|
||||
*/
|
||||
/** Load all tags given their ids. Ids that are not available are ignored. */
|
||||
def loadAll(ids: List[Ident]): F[Vector[RTag]]
|
||||
}
|
||||
|
||||
|
@ -102,8 +102,7 @@ object OUpload {
|
||||
|
||||
def noSource: UploadResult = NoSource
|
||||
|
||||
/** When adding files to an item, no item was found using the given item-id.
|
||||
*/
|
||||
/** When adding files to an item, no item was found using the given item-id. */
|
||||
case object NoItem extends UploadResult
|
||||
|
||||
def noItem: UploadResult = NoItem
|
||||
|
@ -19,8 +19,7 @@ import io.circe.Encoder
|
||||
|
||||
trait OUserTask[F[_]] {
|
||||
|
||||
/** Return the settings for all scan-mailbox tasks of the current user.
|
||||
*/
|
||||
/** Return the settings for all scan-mailbox tasks of the current user. */
|
||||
def getScanMailbox(scope: UserTaskScope): Stream[F, UserTask[ScanMailboxArgs]]
|
||||
|
||||
/** Find a scan-mailbox task by the given id. */
|
||||
@ -29,16 +28,14 @@ trait OUserTask[F[_]] {
|
||||
scope: UserTaskScope
|
||||
): OptionT[F, UserTask[ScanMailboxArgs]]
|
||||
|
||||
/** Updates the scan-mailbox tasks and notifies the joex nodes.
|
||||
*/
|
||||
/** Updates the scan-mailbox tasks and notifies the joex nodes. */
|
||||
def submitScanMailbox(
|
||||
scope: UserTaskScope,
|
||||
subject: Option[String],
|
||||
task: UserTask[ScanMailboxArgs]
|
||||
): F[Unit]
|
||||
|
||||
/** Return the settings for all the notify-due-items task of the current user.
|
||||
*/
|
||||
/** Return the settings for all the notify-due-items task of the current user. */
|
||||
def getNotifyDueItems(scope: UserTaskScope): Stream[F, UserTask[NotifyDueItemsArgs]]
|
||||
|
||||
/** Find a notify-due-items task by the given id. */
|
||||
@ -47,8 +44,7 @@ trait OUserTask[F[_]] {
|
||||
scope: UserTaskScope
|
||||
): OptionT[F, UserTask[NotifyDueItemsArgs]]
|
||||
|
||||
/** Updates the notify-due-items tasks and notifies the joex nodes.
|
||||
*/
|
||||
/** Updates the notify-due-items tasks and notifies the joex nodes. */
|
||||
def submitNotifyDueItems(
|
||||
scope: UserTaskScope,
|
||||
subject: Option[String],
|
||||
|
@ -12,19 +12,15 @@ sealed trait SendResult
|
||||
|
||||
object SendResult {
|
||||
|
||||
/** Mail was successfully sent and stored to db.
|
||||
*/
|
||||
/** Mail was successfully sent and stored to db. */
|
||||
case class Success(id: Ident) extends SendResult
|
||||
|
||||
/** There was a failure sending the mail. The mail is then not saved to db.
|
||||
*/
|
||||
/** There was a failure sending the mail. The mail is then not saved to db. */
|
||||
case class SendFailure(ex: Throwable) extends SendResult
|
||||
|
||||
/** The mail was successfully sent, but storing to db failed.
|
||||
*/
|
||||
/** The mail was successfully sent, but storing to db failed. */
|
||||
case class StoreFailure(ex: Throwable) extends SendResult
|
||||
|
||||
/** Something could not be found required for sending (mail configs, items etc).
|
||||
*/
|
||||
/** Something could not be found required for sending (mail configs, items etc). */
|
||||
case object NotFound extends SendResult
|
||||
}
|
||||
|
@ -23,8 +23,7 @@ object CollectiveState {
|
||||
/** A collective that has been explicitely closed. */
|
||||
case object Closed extends CollectiveState
|
||||
|
||||
/** A collective blocked by a super user, usually some emergency action.
|
||||
*/
|
||||
/** A collective blocked by a super user, usually some emergency action. */
|
||||
case object Blocked extends CollectiveState
|
||||
|
||||
def fromString(s: String): Either[String, CollectiveState] =
|
||||
|
@ -20,8 +20,7 @@ object JobState {
|
||||
/** Waiting for being executed. */
|
||||
case object Waiting extends JobState {}
|
||||
|
||||
/** A scheduler has picked up this job and will pass it to the next free slot.
|
||||
*/
|
||||
/** A scheduler has picked up this job and will pass it to the next free slot. */
|
||||
case object Scheduled extends JobState {}
|
||||
|
||||
/** Is currently executing */
|
||||
|
@ -81,8 +81,7 @@ object MetaProposal {
|
||||
implicit val order: Order[Candidate] =
|
||||
Order.by(_.ref)
|
||||
|
||||
/** This deviates from standard order to sort None at last.
|
||||
*/
|
||||
/** This deviates from standard order to sort None at last. */
|
||||
val weightOrder: Order[Option[Double]] = new Order[Option[Double]] {
|
||||
def compare(x: Option[Double], y: Option[Double]) =
|
||||
(x, y) match {
|
||||
|
@ -15,8 +15,7 @@ import docspell.common.syntax.all._
|
||||
|
||||
import io.circe.{Decoder, Encoder}
|
||||
|
||||
/** A MIME Type impl with just enough features for the use here.
|
||||
*/
|
||||
/** A MIME Type impl with just enough features for the use here. */
|
||||
case class MimeType(primary: String, sub: String, params: Map[String, String]) {
|
||||
def withParam(name: String, value: String): MimeType =
|
||||
copy(params = params.updated(name, value))
|
||||
|
@ -8,8 +8,7 @@ package docspell.common
|
||||
|
||||
import scala.concurrent.ExecutionContext
|
||||
|
||||
/** Captures thread pools to use in an application.
|
||||
*/
|
||||
/** Captures thread pools to use in an application. */
|
||||
case class Pools(
|
||||
connectEC: ExecutionContext,
|
||||
httpClientEC: ExecutionContext,
|
||||
|
@ -14,8 +14,7 @@ import docspell.common._
|
||||
|
||||
object Ocr {
|
||||
|
||||
/** Extract the text of all pages in the given pdf file.
|
||||
*/
|
||||
/** Extract the text of all pages in the given pdf file. */
|
||||
def extractPdf[F[_]: Async](
|
||||
pdf: Stream[F, Byte],
|
||||
logger: Logger[F],
|
||||
@ -30,8 +29,7 @@ object Ocr {
|
||||
.last
|
||||
}
|
||||
|
||||
/** Extract the text from the given image file
|
||||
*/
|
||||
/** Extract the text from the given image file */
|
||||
def extractImage[F[_]: Async](
|
||||
img: Stream[F, Byte],
|
||||
logger: Logger[F],
|
||||
@ -139,8 +137,7 @@ object Ocr {
|
||||
}
|
||||
}
|
||||
|
||||
/** Run tesseract on the given image file and return the extracted text.
|
||||
*/
|
||||
/** Run tesseract on the given image file and return the extracted text. */
|
||||
private[extract] def runTesseractFile[F[_]: Async](
|
||||
img: Path,
|
||||
logger: Logger[F],
|
||||
@ -159,8 +156,7 @@ object Ocr {
|
||||
.map(_.stdout)
|
||||
}
|
||||
|
||||
/** Run tesseract on the given image file and return the extracted text.
|
||||
*/
|
||||
/** Run tesseract on the given image file and return the extracted text. */
|
||||
private[extract] def runTesseractStdin[F[_]: Async](
|
||||
img: Stream[F, Byte],
|
||||
logger: Logger[F],
|
||||
|
@ -22,8 +22,7 @@ import docspell.store.records.RPerson
|
||||
import io.circe.syntax._
|
||||
import org.log4s.getLogger
|
||||
|
||||
/** Maintains a custom regex-ner file per collective for stanford's regexner annotator.
|
||||
*/
|
||||
/** Maintains a custom regex-ner file per collective for stanford's regexner annotator. */
|
||||
trait RegexNerFile[F[_]] {
|
||||
|
||||
def makeFile(collective: Ident): F[Option[Path]]
|
||||
|
@ -10,8 +10,7 @@ import cats.data.Kleisli
|
||||
|
||||
package object fts {
|
||||
|
||||
/** Some work that must be done to advance the schema of the fulltext index.
|
||||
*/
|
||||
/** Some work that must be done to advance the schema of the fulltext index. */
|
||||
type FtsWork[F[_]] = Kleisli[F, FtsContext[F], Unit]
|
||||
|
||||
}
|
||||
|
@ -17,8 +17,7 @@ import docspell.joex.scheduler.{Context, Task}
|
||||
import docspell.store.queries.QItem
|
||||
import docspell.store.records._
|
||||
|
||||
/** Task that creates the item.
|
||||
*/
|
||||
/** Task that creates the item. */
|
||||
object CreateItem {
|
||||
|
||||
def apply[F[_]: Sync]: Task[F, ProcessItemArgs, ItemData] =
|
||||
|
@ -14,8 +14,7 @@ import docspell.joex.scheduler.{Context, Task}
|
||||
import docspell.store.AddResult
|
||||
import docspell.store.records._
|
||||
|
||||
/** Saves the proposals in the database
|
||||
*/
|
||||
/** Saves the proposals in the database */
|
||||
object SaveProposals {
|
||||
type Args = ProcessItemArgs
|
||||
|
||||
|
@ -13,8 +13,7 @@ import cats.implicits._
|
||||
|
||||
import docspell.common.Logger
|
||||
|
||||
/** The code that is executed by the scheduler
|
||||
*/
|
||||
/** The code that is executed by the scheduler */
|
||||
trait Task[F[_], A, B] {
|
||||
|
||||
def run(ctx: Context[F, A]): F[B]
|
||||
|
@ -51,7 +51,8 @@ class UpdateCheckTest extends FunSuite {
|
||||
|
||||
object UpdateCheckTest {
|
||||
|
||||
val exampleResponsePartial = """
|
||||
val exampleResponsePartial =
|
||||
"""
|
||||
|{
|
||||
| "url": "https://api.github.com/repos/eikek/docspell/releases/99899888",
|
||||
| "assets_url": "https://api.github.com/repos/eikek/docspell/releases/99899888/assets",
|
||||
|
@ -14,8 +14,7 @@ import docspell.query.ItemQuery.Expr.NotExpr
|
||||
import docspell.query.ItemQuery.Expr.OrExpr
|
||||
import docspell.query.ItemQuery._
|
||||
|
||||
/** Currently, fulltext in a query is only supported when in "root AND" position
|
||||
*/
|
||||
/** Currently, fulltext in a query is only supported when in "root AND" position */
|
||||
object FulltextExtract {
|
||||
|
||||
sealed trait Result
|
||||
|
@ -73,8 +73,7 @@ object StringUtil {
|
||||
(P.char('\\') ~ after).void
|
||||
}
|
||||
|
||||
/** String content without the delimiter
|
||||
*/
|
||||
/** String content without the delimiter */
|
||||
def undelimitedString(endP: P[Unit]): P[String] =
|
||||
escapedToken.backtrack
|
||||
.orElse((!endP).with1 ~ P.anyChar)
|
||||
|
@ -16,8 +16,7 @@ import org.http4s._
|
||||
import org.http4s.headers._
|
||||
import org.typelevel.ci.CIString
|
||||
|
||||
/** Obtain information about the client by inspecting the request.
|
||||
*/
|
||||
/** Obtain information about the client by inspecting the request. */
|
||||
object ClientRequestInfo {
|
||||
|
||||
def getBaseUrl[F[_]](cfg: Config, req: Request[F]): LenientUri =
|
||||
|
@ -12,17 +12,14 @@ import docspell.store.qb.impl.SelectBuilder
|
||||
|
||||
import doobie._
|
||||
|
||||
/** A sql select statement that allows to change certain parts of the query.
|
||||
*/
|
||||
/** A sql select statement that allows to change certain parts of the query. */
|
||||
sealed trait Select {
|
||||
|
||||
/** Builds the sql select statement into a doobie fragment.
|
||||
*/
|
||||
/** Builds the sql select statement into a doobie fragment. */
|
||||
def build: Fragment =
|
||||
SelectBuilder(this)
|
||||
|
||||
/** When using this as a sub-select, an alias is required.
|
||||
*/
|
||||
/** When using this as a sub-select, an alias is required. */
|
||||
def as(alias: String): SelectExpr.SelectQuery =
|
||||
SelectExpr.SelectQuery(this, Some(alias))
|
||||
|
||||
|
@ -33,16 +33,13 @@ trait PeriodicTaskStore[F[_]] {
|
||||
|
||||
def findNonFinalJob(pjobId: Ident): F[Option[RJob]]
|
||||
|
||||
/** Insert a task or update if it already exists.
|
||||
*/
|
||||
/** Insert a task or update if it already exists. */
|
||||
def insert(task: RPeriodicTask): F[Unit]
|
||||
|
||||
/** Adds the task only if it not already exists.
|
||||
*/
|
||||
/** Adds the task only if it not already exists. */
|
||||
def add(task: RPeriodicTask): F[AddResult]
|
||||
|
||||
/** Find all joex nodes as registered in the database.
|
||||
*/
|
||||
/** Find all joex nodes as registered in the database. */
|
||||
def findJoexNodes: F[Vector[RNode]]
|
||||
}
|
||||
|
||||
|
@ -227,8 +227,7 @@ object RAttachment {
|
||||
).orderBy(a.position.asc).build.query[(RAttachment, RFileMeta)].to[Vector]
|
||||
}
|
||||
|
||||
/** Deletes the attachment and its related source and meta records.
|
||||
*/
|
||||
/** Deletes the attachment and its related source and meta records. */
|
||||
def delete(attachId: Ident): ConnectionIO[Int] =
|
||||
for {
|
||||
n0 <- RAttachmentMeta.delete(attachId)
|
||||
|
@ -17,8 +17,7 @@ import docspell.store.qb._
|
||||
import doobie._
|
||||
import doobie.implicits._
|
||||
|
||||
/** Combines a source record (RSource) and a list of associated tags.
|
||||
*/
|
||||
/** Combines a source record (RSource) and a list of associated tags. */
|
||||
case class SourceData(source: RSource, tags: Vector[RTag])
|
||||
|
||||
object SourceData {
|
||||
|
@ -33,8 +33,7 @@ import io.circe._
|
||||
*/
|
||||
trait UserTaskStore[F[_]] {
|
||||
|
||||
/** Return all tasks of the given user.
|
||||
*/
|
||||
/** Return all tasks of the given user. */
|
||||
def getAll(scope: UserTaskScope): Stream[F, UserTask[String]]
|
||||
|
||||
/** Return all tasks of the given name and user. The task's arguments are returned as
|
||||
@ -61,8 +60,7 @@ trait UserTaskStore[F[_]] {
|
||||
implicit E: Encoder[A]
|
||||
): F[Int]
|
||||
|
||||
/** Delete the task with the given id of the given user.
|
||||
*/
|
||||
/** Delete the task with the given id of the given user. */
|
||||
def deleteTask(scope: UserTaskScope, id: Ident): F[Int]
|
||||
|
||||
/** Return the task of the given user and name. If multiple exists, an error is
|
||||
@ -91,8 +89,7 @@ trait UserTaskStore[F[_]] {
|
||||
implicit E: Encoder[A]
|
||||
): F[UserTask[String]]
|
||||
|
||||
/** Delete all tasks of the given user that have name `name'.
|
||||
*/
|
||||
/** Delete all tasks of the given user that have name `name'. */
|
||||
def deleteAll(scope: UserTaskScope, name: Ident): F[Int]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user