From 698b751a939429463747ed9722e91d6d11069db3 Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Thu, 18 Apr 2024 21:32:03 +0900 Subject: [PATCH] chore(plugins): delete `wartremover` --- build.sbt | 3 --- project/Wartremover.scala | 15 --------------- project/plugins.sbt | 1 - .../qualtet/config/ApplicationConfig.scala | 1 - .../qualtet/domains/search/SearchService.scala | 2 -- .../domains/search/repositories/SearchQuery.scala | 1 - 6 files changed, 23 deletions(-) delete mode 100644 project/Wartremover.scala diff --git a/build.sbt b/build.sbt index 6f1c98e7..61dfea66 100644 --- a/build.sbt +++ b/build.sbt @@ -41,9 +41,6 @@ lazy val root = (project in file(".")) .settings( libraryDependencies ++= Dependencies.dependencies ) - .settings( - Compile / compile / wartremoverWarnings ++= Wartremover.rules - ) .settings( assembly / mainClass := Some("net.yoshinorin.qualtet.BootStrap") ) diff --git a/project/Wartremover.scala b/project/Wartremover.scala deleted file mode 100644 index e5cb61a7..00000000 --- a/project/Wartremover.scala +++ /dev/null @@ -1,15 +0,0 @@ -import wartremover.{Wart, Warts} - -// https://www.wartremover.org/ -object Wartremover { - - val rules = Warts.allBut( - Wart.StringPlusAny, - Wart.Throw, - Wart.DefaultArguments, - Wart.Overloading, - Wart.Nothing, - Wart.ToString - ) - -} diff --git a/project/plugins.sbt b/project/plugins.sbt index c242a715..ddc4f9f5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,7 +6,6 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.9") addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0") -addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.1.6") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1") diff --git a/src/main/scala/net/yoshinorin/qualtet/config/ApplicationConfig.scala b/src/main/scala/net/yoshinorin/qualtet/config/ApplicationConfig.scala index c1803e4d..26bc3241 100644 --- a/src/main/scala/net/yoshinorin/qualtet/config/ApplicationConfig.scala +++ b/src/main/scala/net/yoshinorin/qualtet/config/ApplicationConfig.scala @@ -36,7 +36,6 @@ object ApplicationConfig { private val httpEndpoints: HttpEndpointsConfig = HttpEndpointsConfig(system = HttpSystemEndpointConfig(metadata = HttpSystemEndpointMetadata(config.getBoolean("http.endpoints.system.metadata.enabled")))) - @SuppressWarnings(Array("org.wartremover.warts.AsInstanceOf")) private val corsAllowOrigins: List[String] = config.getList("cors.allow-origins").unwrapped().asInstanceOf[ArrayList[String]].asScala.toList private val jwtIss: String = config.getString("jwt.iss") diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala b/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala index 2a7e5e35..2bbbee2b 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/search/SearchService.scala @@ -76,7 +76,6 @@ class SearchService[F[_]: Monad]( words.flatMap(w => sentence.position(w).map(x => x.expand(8, 24, sentence.length))) } - @SuppressWarnings(Array("org.wartremover.warts.IterableOps")) @tailrec private def calcSubStrRanges(idxes: Seq[Points], acc: Seq[Points] = Nil): Seq[Points] = { idxes.headOption match { @@ -94,7 +93,6 @@ class SearchService[F[_]: Monad]( } @tailrec - @SuppressWarnings(Array("org.wartremover.warts.SeqApply")) private def substrRecursively(sentence: String, idxes: Seq[Points], current: Int = 0, acc: String = ""): String = { if (idxes.sizeIs > current) { val currentIdx = idxes(current) diff --git a/src/main/scala/net/yoshinorin/qualtet/domains/search/repositories/SearchQuery.scala b/src/main/scala/net/yoshinorin/qualtet/domains/search/repositories/SearchQuery.scala index 60192722..aadda09c 100644 --- a/src/main/scala/net/yoshinorin/qualtet/domains/search/repositories/SearchQuery.scala +++ b/src/main/scala/net/yoshinorin/qualtet/domains/search/repositories/SearchQuery.scala @@ -6,7 +6,6 @@ import doobie.util.query.Query0 object SearchQuery { // https://tpolecat.github.io/doobie/docs/08-Fragments.html - @SuppressWarnings(Array("org.wartremover.warts.IterableOps")) def search(query: List[String]): Read[(Int, ResponseSearch)] ?=> Query0[(Int, ResponseSearch)] = { // TODO: LIMIT should be configurable // TODO: ORDER BY asc, title...etc