From 9ffa29459d5fd8b2b248fee8f9a2024b2f9c1692 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 19 Jun 2020 20:45:56 +0200 Subject: [PATCH 1/5] Update scalafmt-core to 2.6.1 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index f460f8d1..95023d27 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "2.6.0" +version = "2.6.1" preset = defaultWithAlign From 48afb9957319ce9ab8b5a07a796fe4d1dac945c1 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 19 Jun 2020 20:46:03 +0200 Subject: [PATCH 2/5] Update swagger-ui to 3.27.0 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index edab1ff3..ac1fca92 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -32,7 +32,7 @@ object Dependencies { val StanfordNlpVersion = "3.9.2" val TikaVersion = "1.24.1" val YamuscaVersion = "0.6.2" - val SwaggerUIVersion = "3.26.1" + val SwaggerUIVersion = "3.27.0" val SemanticUIVersion = "2.4.1" val TwelveMonkeysVersion = "3.5" val JQueryVersion = "3.5.1" From e3b9670d5abee5efc91f8f9b45d4b21c6cae0212 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 20 Jun 2020 01:00:52 +0200 Subject: [PATCH 3/5] Update sbt-sonatype to 3.9.3 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 7df4419a..62693ddd 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.3") addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.2") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.3") From 7609b2b7c3f00b5a64173b0f5e5c9fe49879d92f Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 20 Jun 2020 23:03:51 +0200 Subject: [PATCH 4/5] Run scalafmtAll --- .../src/main/scala/docspell/backend/ops/OUpload.scala | 3 ++- .../src/main/scala/docspell/common/CollectiveState.scala | 6 ++++-- .../common/src/main/scala/docspell/common/JobState.scala | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala b/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala index 0a74c9e5..70fda316 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala @@ -86,7 +86,8 @@ object OUpload { def noSource: UploadResult = NoSource /** When adding files to an item, no item was found using the given - * item-id. */ + * item-id. + */ case object NoItem extends UploadResult def noItem: UploadResult = NoItem diff --git a/modules/common/src/main/scala/docspell/common/CollectiveState.scala b/modules/common/src/main/scala/docspell/common/CollectiveState.scala index a6e6e006..04e42128 100644 --- a/modules/common/src/main/scala/docspell/common/CollectiveState.scala +++ b/modules/common/src/main/scala/docspell/common/CollectiveState.scala @@ -11,14 +11,16 @@ object CollectiveState { /** A collective may be readonly in cases it is implicitly closed * (e.g. no payment). Users can still see there data and - * download, but have no write access. */ + * download, but have no write access. + */ case object ReadOnly extends CollectiveState /** A collective that has been explicitely closed. */ case object Closed extends CollectiveState /** A collective blocked by a super user, usually some emergency - * action. */ + * action. + */ case object Blocked extends CollectiveState def fromString(s: String): Either[String, CollectiveState] = diff --git a/modules/common/src/main/scala/docspell/common/JobState.scala b/modules/common/src/main/scala/docspell/common/JobState.scala index e47475c6..68567dcd 100644 --- a/modules/common/src/main/scala/docspell/common/JobState.scala +++ b/modules/common/src/main/scala/docspell/common/JobState.scala @@ -13,7 +13,8 @@ object JobState { case object Waiting extends JobState {} /** A scheduler has picked up this job and will pass it to the next - * free slot. */ + * free slot. + */ case object Scheduled extends JobState {} /** Is currently executing */ From 9db3c70e3facc14c991464651cac80f39b75b40b Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Tue, 23 Jun 2020 00:28:04 +0200 Subject: [PATCH 5/5] ScalafmtAll to sbt files --- project/Dependencies.scala | 142 ++++++++++++++++++---------------- project/NerModelsPlugin.scala | 49 +++++++----- 2 files changed, 103 insertions(+), 88 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index ac1fca92..59df4b4a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,40 +4,39 @@ import sbt._ object Dependencies { - val BcryptVersion = "0.4" + val BcryptVersion = "0.4" val BetterMonadicForVersion = "0.3.1" - val BitpeaceVersion = "0.5.0" - val CalevVersion = "0.3.1" - val CirceVersion = "0.13.0" - val DoobieVersion = "0.9.0" - val EmilVersion = "0.6.1" - val FastparseVersion = "2.1.3" - val FlexmarkVersion = "0.62.2" - val FlywayVersion = "6.4.4" - val Fs2Version = "2.4.2" - val H2Version = "1.4.200" - val Http4sVersion = "0.21.4" - val Icu4jVersion = "67.1" - val JsoupVersion = "1.13.1" - val KindProjectorVersion = "0.10.3" - val Log4sVersion = "1.8.2" - val LogbackVersion = "1.2.3" - val MariaDbVersion = "2.6.0" - val MiniTestVersion = "2.8.2" - val PdfboxVersion = "2.0.20" - val PoiVersion = "4.1.2" - val PostgresVersion = "42.2.14" - val PureConfigVersion = "0.12.3" - val Slf4jVersion = "1.7.30" - val StanfordNlpVersion = "3.9.2" - val TikaVersion = "1.24.1" - val YamuscaVersion = "0.6.2" - val SwaggerUIVersion = "3.27.0" - val SemanticUIVersion = "2.4.1" - val TwelveMonkeysVersion = "3.5" - val JQueryVersion = "3.5.1" - val ViewerJSVersion = "0.5.8" - + val BitpeaceVersion = "0.5.0" + val CalevVersion = "0.3.1" + val CirceVersion = "0.13.0" + val DoobieVersion = "0.9.0" + val EmilVersion = "0.6.1" + val FastparseVersion = "2.1.3" + val FlexmarkVersion = "0.62.2" + val FlywayVersion = "6.4.4" + val Fs2Version = "2.4.2" + val H2Version = "1.4.200" + val Http4sVersion = "0.21.4" + val Icu4jVersion = "67.1" + val JsoupVersion = "1.13.1" + val KindProjectorVersion = "0.10.3" + val Log4sVersion = "1.8.2" + val LogbackVersion = "1.2.3" + val MariaDbVersion = "2.6.0" + val MiniTestVersion = "2.8.2" + val PdfboxVersion = "2.0.20" + val PoiVersion = "4.1.2" + val PostgresVersion = "42.2.14" + val PureConfigVersion = "0.12.3" + val Slf4jVersion = "1.7.30" + val StanfordNlpVersion = "3.9.2" + val TikaVersion = "1.24.1" + val YamuscaVersion = "0.6.2" + val SwaggerUIVersion = "3.27.0" + val SemanticUIVersion = "2.4.1" + val TwelveMonkeysVersion = "3.5" + val JQueryVersion = "3.5.1" + val ViewerJSVersion = "0.5.8" val calevCore = Seq( "com.github.eikek" %% "calev-core" % CalevVersion @@ -57,23 +56,27 @@ object Dependencies { ) val poi = Seq( - "org.apache.poi" % "poi" % PoiVersion, - "org.apache.poi" % "poi-ooxml" % PoiVersion, - "org.apache.poi" % "poi-scratchpad" % PoiVersion, - ).map(_.excludeAll( - ExclusionRule("commons-logging") - )) ++ jclOverSlf4j + "org.apache.poi" % "poi" % PoiVersion, + "org.apache.poi" % "poi-ooxml" % PoiVersion, + "org.apache.poi" % "poi-scratchpad" % PoiVersion + ).map( + _.excludeAll( + ExclusionRule("commons-logging") + ) + ) ++ jclOverSlf4j // https://github.com/vsch/flexmark-java // BSD 2-Clause val flexmark = Seq( - "com.vladsch.flexmark" % "flexmark" % FlexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-tables" % FlexmarkVersion, + "com.vladsch.flexmark" % "flexmark" % FlexmarkVersion, + "com.vladsch.flexmark" % "flexmark-ext-tables" % FlexmarkVersion, "com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % FlexmarkVersion - ).map(_.excludeAll( - ExclusionRule("junit"), - ExclusionRule("hamcrest-core") - )) + ).map( + _.excludeAll( + ExclusionRule("junit"), + ExclusionRule("hamcrest-core") + ) + ) val twelvemonkeys = Seq( "com.twelvemonkeys.imageio" % "imageio-jpeg" % TwelveMonkeysVersion, @@ -81,30 +84,30 @@ object Dependencies { ) val pdfbox = Seq( - "org.apache.pdfbox" % "pdfbox" % PdfboxVersion excludeAll ( + ("org.apache.pdfbox" % "pdfbox" % PdfboxVersion).excludeAll( ExclusionRule("org.bouncycastle"), ExclusionRule("commons-logging") ) ) ++ jclOverSlf4j val emilCommon = Seq( - "com.github.eikek" %% "emil-common" % EmilVersion, + "com.github.eikek" %% "emil-common" % EmilVersion ) val emil = Seq( - "com.github.eikek" %% "emil-common" % EmilVersion, - "com.github.eikek" %% "emil-javamail" % EmilVersion + "com.github.eikek" %% "emil-common" % EmilVersion, + "com.github.eikek" %% "emil-javamail" % EmilVersion ) val emilDoobie = Seq( - "com.github.eikek" %% "emil-doobie" % EmilVersion, + "com.github.eikek" %% "emil-doobie" % EmilVersion ) val emilTnef = Seq( - "com.github.eikek" %% "emil-tnef" % EmilVersion, + "com.github.eikek" %% "emil-tnef" % EmilVersion ) val emilMarkdown = Seq( - "com.github.eikek" %% "emil-markdown" % EmilVersion, + "com.github.eikek" %% "emil-markdown" % EmilVersion ) val emilJsoup = Seq( - "com.github.eikek" %% "emil-jsoup" % EmilVersion, + "com.github.eikek" %% "emil-jsoup" % EmilVersion ) val jsoup = Seq( @@ -112,7 +115,7 @@ object Dependencies { ) val stanfordNlpCore = Seq( - "edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion excludeAll( + ("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion).excludeAll( ExclusionRule("com.io7m.xom", "xom"), ExclusionRule("javax.servlet", "javax.servlet-api"), ExclusionRule("org.apache.lucene", "lucene-queryparser"), @@ -130,8 +133,11 @@ object Dependencies { ) val stanfordNlpModels = Seq( - "edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion classifier "models-german", - "edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion classifier "models-english" + ("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion) + .classifier("models-german"), + ("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion).classifier( + "models-english" + ) ) val tika = Seq( @@ -150,22 +156,22 @@ object Dependencies { val fs2 = Seq( "co.fs2" %% "fs2-core" % Fs2Version, - "co.fs2" %% "fs2-io" % Fs2Version + "co.fs2" %% "fs2-io" % Fs2Version ) val http4s = Seq( "org.http4s" %% "http4s-blaze-server" % Http4sVersion, "org.http4s" %% "http4s-circe" % Http4sVersion, - "org.http4s" %% "http4s-dsl" % Http4sVersion, + "org.http4s" %% "http4s-dsl" % Http4sVersion ) - + val http4sClient = Seq( "org.http4s" %% "http4s-blaze-client" % Http4sVersion ) val circe = Seq( "io.circe" %% "circe-generic" % CirceVersion, - "io.circe" %% "circe-parser" % CirceVersion + "io.circe" %% "circe-parser" % CirceVersion ) // https://github.com/Log4s/log4s;ASL 2.0 @@ -203,7 +209,7 @@ object Dependencies { // https://github.com/tpolecat/doobie // MIT val doobie = Seq( - "org.tpolecat" %% "doobie-core" % DoobieVersion, + "org.tpolecat" %% "doobie-core" % DoobieVersion, "org.tpolecat" %% "doobie-hikari" % DoobieVersion ) @@ -224,18 +230,18 @@ object Dependencies { val miniTest = Seq( // https://github.com/monix/minitest // Apache 2.0 - "io.monix" %% "minitest" % MiniTestVersion, + "io.monix" %% "minitest" % MiniTestVersion, "io.monix" %% "minitest-laws" % MiniTestVersion ).map(_ % Test) - val kindProjectorPlugin = "org.typelevel" %% "kind-projector" % KindProjectorVersion - val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % BetterMonadicForVersion + val kindProjectorPlugin = "org.typelevel" %% "kind-projector" % KindProjectorVersion + val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % BetterMonadicForVersion val webjars = Seq( - "org.webjars" % "swagger-ui" % SwaggerUIVersion, - "org.webjars" % "Semantic-UI"% SemanticUIVersion, - "org.webjars" % "jquery" % JQueryVersion, - "org.webjars" % "viewerjs" % ViewerJSVersion + "org.webjars" % "swagger-ui" % SwaggerUIVersion, + "org.webjars" % "Semantic-UI" % SemanticUIVersion, + "org.webjars" % "jquery" % JQueryVersion, + "org.webjars" % "viewerjs" % ViewerJSVersion ) val icu4j = Seq( diff --git a/project/NerModelsPlugin.scala b/project/NerModelsPlugin.scala index 4ad2b461..cb658615 100644 --- a/project/NerModelsPlugin.scala +++ b/project/NerModelsPlugin.scala @@ -20,30 +20,34 @@ object NerModelsPlugin extends AutoPlugin { object autoImport { val NerModels = config("NerModels") - val nerModelsFilter = settingKey[String => Boolean]("Which files to keep.") + val nerModelsFilter = settingKey[String => Boolean]("Which files to keep.") val nerModelsRunFilter = taskKey[Seq[File]]("Extract files from libraryDependencies") } import autoImport._ - def nerModelSettings: Seq[Setting[_]] = Seq( - nerModelsFilter := (_ => false), - nerModelsRunFilter := { - filterArtifacts(streams.value.log - , Classpaths.managedJars(NerModels, Set("jar", "zip"), update.value) - , nerModelsFilter.value - , (Compile/resourceManaged).value) - }, - Compile / resourceGenerators += nerModelsRunFilter.taskValue - ) + def nerModelSettings: Seq[Setting[_]] = + Seq( + nerModelsFilter := (_ => false), + nerModelsRunFilter := { + filterArtifacts( + streams.value.log, + Classpaths.managedJars(NerModels, Set("jar", "zip"), update.value), + nerModelsFilter.value, + (Compile / resourceManaged).value + ) + }, + Compile / resourceGenerators += nerModelsRunFilter.taskValue + ) - def nerClassifierSettings: Seq[Setting[_]] = Seq( - libraryDependencies ++= Dependencies.stanfordNlpModels.map(_ % NerModels), - nerModelsFilter := { - name => nerModels.exists(name.endsWith) - } - ) + def nerClassifierSettings: Seq[Setting[_]] = + Seq( + libraryDependencies ++= Dependencies.stanfordNlpModels.map(_ % NerModels), + nerModelsFilter := { name => + nerModels.exists(name.endsWith) + } + ) override def projectConfigurations: Seq[Configuration] = Seq(NerModels) @@ -51,11 +55,16 @@ object NerModelsPlugin extends AutoPlugin { override def projectSettings: Seq[Setting[_]] = nerModelSettings - def filterArtifacts(logger: Logger, cp: Classpath, nameFilter: NameFilter, out: File): Seq[File] = { + def filterArtifacts( + logger: Logger, + cp: Classpath, + nameFilter: NameFilter, + out: File + ): Seq[File] = { logger.info(s"NerModels: Filtering artifacts...") - cp.files.flatMap(f => { + cp.files.flatMap { f => IO.unzip(f, out, nameFilter) - }) + } } private val nerModels = List(