Skip to content

Commit ade8a83

Browse files
authored
fix: Remove WartRemover as it was not working properly on Scala 2.13 (#147)
build: Update dependencies refactor: Small improvements
1 parent 3c535cf commit ade8a83

File tree

24 files changed

+22
-83
lines changed

24 files changed

+22
-83
lines changed

.scalafix.conf

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
rules = [
2-
SortImports
32
Disable
43
DisableSyntax
54
LeakingImplicitClassVal
@@ -8,13 +7,7 @@ rules = [
87
NoValInForComprehension
98
ProcedureSyntax
109
RemoveUnused
11-
]
12-
13-
# the same order as IntelliJ does it, we don't want Scalafix and IDEA fight each other
14-
SortImports.blocks = [
15-
"java."
16-
"*"
17-
"scala."
10+
SortImports
1811
]
1912

2013
Disable.symbols = [
@@ -168,14 +161,9 @@ DisableSyntax {
168161
noXml = true
169162
}
170163

171-
ExplicitResultTypes {
172-
fatalWarnings = true
173-
174-
# these apply to non-implicits
175-
memberKind = [Def, Val]
176-
memberVisibility = [Public, Protected]
177-
178-
# turn to the max...
179-
skipSimpleDefinitions = false
180-
skipLocalImplicits = false
181-
}
164+
# IntelliJ IDEA's order in order not to fight each other
165+
SortImports.blocks = [
166+
"java."
167+
"*"
168+
"scala."
169+
]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Scala Server Toolkit
22

33
![Build Status](https://github.com/avast/scala-server-toolkit/workflows/Build/badge.svg)
4-
[![Maven Central](https://img.shields.io/maven-central/v/com.avast/sst-bundle-zio-http4s-blaze_2.12)](https://repo1.maven.org/maven2/com/avast/sst-bundle-zio-http4s-blaze_2.12/)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.avast/sst-bundle-zio-http4s-blaze_2.13)](https://repo1.maven.org/maven2/com/avast/sst-bundle-zio-http4s-blaze_2.12/)
55
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-brightgreen.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
66
[![Mergify badge](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/avast/scala-server-toolkit)](https://mergify.io)
77

build.sbt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ lazy val monixCatnapPureConfig = project
349349
.in(file("monix-catnap-pureconfig"))
350350
.dependsOn(monixCatnap)
351351
.settings(BuildSettings.common)
352-
.settings(run / fork := true, name := "sst-monix-catnap-pureconfig", libraryDependencies += Dependencies.pureConfig)
352+
.settings(
353+
name := "sst-monix-catnap-pureconfig",
354+
libraryDependencies += Dependencies.pureConfig
355+
)
353356

354357
lazy val pureConfig = project
355358
.in(file("pureconfig"))

flyway/src/main/scala/com/avast/sst/flyway/FlywayModule.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.flywaydb.core.Flyway
77
object FlywayModule {
88

99
/** Makes [[org.flywaydb.core.Flyway]] from the given [[javax.sql.DataSource]] and config. */
10-
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
1110
def make[F[_]: Sync](dataSource: DataSource, config: FlywayConfig): F[Flyway] = {
1211
Sync[F].delay {
1312
val builder = Flyway

grpc-server/src/main/scala/com/avast/sst/grpc/server/GrpcServerModule.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ object GrpcServerModule {
1515
* @param executionContext executor to be used for the server
1616
* @param interceptors that are run for all the services
1717
*/
18-
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
1918
def make[F[_]: Sync](config: GrpcServerConfig,
2019
services: Seq[ServerServiceDefinition],
2120
executionContext: ExecutionContext,

http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClientModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import org.http4s.client.Client
66
import org.http4s.client.blaze.BlazeClientBuilder
77

88
import scala.concurrent.ExecutionContext
9-
import scala.language.higherKinds
10-
119
object Http4sBlazeClientModule {
1210

1311
/** Makes [[org.http4s.client.Client]] (Blaze) initialized with the given config.

http4s-server-blaze/src/main/scala/com/avast/sst/http4s/server/Http4sBlazeServerModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import org.http4s.server.blaze.BlazeServerBuilder
99

1010
import scala.concurrent.ExecutionContext
1111
import scala.concurrent.duration.Duration
12-
import scala.language.higherKinds
13-
1412
object Http4sBlazeServerModule {
1513

1614
/** Makes [[org.http4s.server.Server]] (Blaze) initialized with the given config and [[org.http4s.HttpApp]].

http4s-server-micrometer/src/main/scala/com/avast/sst/http4s/server/micrometer/MicrometerHttp4sServerMetricsModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import io.micrometer.core.instrument.MeterRegistry
77
import org.http4s.HttpRoutes
88
import org.http4s.server.middleware.Metrics
99

10-
import scala.language.higherKinds
11-
1210
class MicrometerHttp4sServerMetricsModule[F[_]: Sync](val serverMetrics: HttpRoutes[F] => HttpRoutes[F], val routeMetrics: RouteMetrics[F])
1311

1412
object MicrometerHttp4sServerMetricsModule {

http4s-server-micrometer/src/main/scala/com/avast/sst/http4s/server/micrometer/RouteMetrics.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import cats.syntax.functor._
99
import io.micrometer.core.instrument.MeterRegistry
1010
import org.http4s.Response
1111

12-
import scala.language.higherKinds
13-
1412
/** Provides the usual metrics for single HTTP route. */
1513
class RouteMetrics[F[_]: Sync](meterRegistry: MeterRegistry, clock: Clock[F]) {
1614

http4s-server/src/main/scala/com/avast/sst/http4s/server/Http4sRouting.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import cats.syntax.all._
55
import org.http4s.syntax.kleisli._
66
import org.http4s.{HttpApp, HttpRoutes}
77

8-
import scala.language.higherKinds
9-
108
object Http4sRouting {
119

1210
/** Makes [[org.http4s.HttpApp]] from [[org.http4s.HttpRoutes]] */

http4s-server/src/main/scala/com/avast/sst/http4s/server/middleware/CorrelationIdMiddleware.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import org.http4s.util.CaseInsensitiveString
1111
import org.http4s.{Header, HttpRoutes, Request, Response}
1212
import org.slf4j.LoggerFactory
1313

14-
import scala.language.higherKinds
15-
1614
/** Provides correlation ID functionality. Either generates new correlation ID for a request or takes the one sent in HTTP header
1715
* and puts it to [[org.http4s.Request]] attributes. It is also filled into HTTP response header.
1816
*

jvm/src/main/scala/com/avast/sst/jvm/execution/ExecutorModule.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import cats.effect.{Blocker, Resource, Sync}
1616
import com.avast.sst.jvm.execution.ConfigurableThreadFactory.Config
1717

1818
import scala.concurrent.{ExecutionContext, ExecutionContextExecutorService}
19-
import scala.language.higherKinds
2019

2120
/** Provides necessary executors - the default one for execution of your business logic and callbacks and special one designated for
2221
* blocking operations. Also allows you to create more executors if you need them.

jvm/src/main/scala/com/avast/sst/jvm/system/console/Console.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import java.io.{OutputStream, Reader}
55
import cats.effect.Sync
66

77
import scala.io.StdIn
8-
import scala.language.higherKinds
98
import scala.{Console => SConsole}
109

1110
/** Pure console allowing to read and print lines. */

jvm/src/main/scala/com/avast/sst/jvm/system/console/ConsoleModule.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.avast.sst.jvm.system.console
22

33
import cats.effect.Sync
44

5-
import scala.language.higherKinds
65
import scala.{Console => SConsole}
76

87
/** Provides console - standard in/out/err. */

jvm/src/main/scala/com/avast/sst/jvm/system/random/Random.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package com.avast.sst.jvm.system.random
22

33
import cats.effect.Sync
44

5-
import scala.language.higherKinds
6-
75
/** Pure pseudo-random number generator based on the JVM implementation. */
86
trait Random[F[_]] {
97

jvm/src/main/scala/com/avast/sst/jvm/system/random/RandomModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import java.security.SecureRandom
44

55
import cats.effect.Sync
66

7-
import scala.language.higherKinds
8-
97
/** Provides random number generators. */
108
object RandomModule {
119

micrometer-jmx/src/main/scala/com/avast/sst/micrometer/jmx/MicrometerJmxModule.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ import io.micrometer.core.instrument.config.NamingConvention
1010
import io.micrometer.core.instrument.util.HierarchicalNameMapper
1111
import io.micrometer.jmx.{JmxConfig, JmxMeterRegistry}
1212

13-
import scala.language.higherKinds
14-
1513
object MicrometerJmxModule {
1614

1715
/** Makes configured [[io.micrometer.jmx.JmxMeterRegistry]]. */
18-
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
1916
def make[F[_]: Sync](config: MicrometerJmxConfig,
2017
clock: Clock = Clock.SYSTEM,
2118
nameMapper: HierarchicalNameMapper = HierarchicalNameMapper.DEFAULT): Resource[F, JmxMeterRegistry] = {

micrometer-jmx/src/main/scala/com/avast/sst/micrometer/jmx/TypeScopeNameObjectNameFactory.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ private[jmx] class TypeScopeNameObjectNameFactory(separator: String = ".") exten
2323
parsedName.getOrElse(defaultFactory.createName(`type`, domain, name))
2424
}
2525

26-
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
2726
private def parseName(domain: String, name: String) = Either.catchNonFatal {
2827
val parts = name.split(quotedSeparator, partNames.length)
2928

micrometer-statsd/src/main/scala/com/avast/sst/micrometer/statsd/MicrometerStatsDModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import io.micrometer.core.instrument.Clock
77
import io.micrometer.core.instrument.util.HierarchicalNameMapper
88
import io.micrometer.statsd.{StatsdConfig, StatsdFlavor, StatsdMeterRegistry, StatsdProtocol}
99

10-
import scala.language.higherKinds
11-
1210
object MicrometerStatsDModule {
1311

1412
/** Makes configured [[io.micrometer.statsd.StatsdMeterRegistry]]. */

project/BuildSettings.scala

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import sbt.Keys._
66
import sbt.{Def, _}
77
import sbtunidoc.ScalaUnidocPlugin.autoImport._
88
import scalafix.sbt.ScalafixPlugin.autoImport._
9-
import wartremover.Wart
10-
import wartremover.WartRemover.autoImport._
119

1210
object BuildSettings {
1311

@@ -17,41 +15,22 @@ object BuildSettings {
1715
libraryDependencies ++= Seq(
1816
compilerPlugin(Dependencies.kindProjector),
1917
compilerPlugin(Dependencies.silencer),
20-
compilerPlugin(scalafixSemanticdb), // for Scalafix
18+
compilerPlugin(scalafixSemanticdb), // necessary for Scalafix
2119
Dependencies.silencerLib,
2220
Dependencies.catsEffect,
2321
Dependencies.logbackClassic % Test,
2422
Dependencies.scalaTest % Test
2523
),
26-
Compile / compile / wartremoverErrors ++= Warts.all filterNot Set(
27-
Wart.Null, // checked by Scalafix
28-
Wart.Nothing, // keep, false positives all around
29-
Wart.Overloading,
30-
Wart.Any, // keep, false positives all around
31-
Wart.Equals, // checked by Scalafix
32-
Wart.ToString, // checked by Scalafix
33-
Wart.Product, // checked by Scalafix
34-
Wart.Serializable, // checked by Scalafix
35-
Wart.DefaultArguments // for constructors for PureConfig
36-
),
3724
ThisBuild / scalafixDependencies ++= Seq(
38-
Dependencies.scalazzi,
39-
Dependencies.sortImports
25+
Dependencies.scalafixScaluzzi,
26+
Dependencies.scalafixSortImports
4027
),
4128
scalacOptions ++= Seq(
42-
"-Yrangepos", // for Scalafix. required by SemanticDB compiler plugin
43-
"-Ywarn-unused", // for Scalafix. not present in sbt-tpolecat for 2.13
29+
"-Yrangepos", // necessary for Scalafix (required by SemanticDB compiler plugin)
30+
"-Ywarn-unused", // necessary for Scalafix RemoveUnused rule (not present in sbt-tpolecat for 2.13)
4431
"-P:silencer:checkUnused"
4532
),
46-
Compile / doc / sources := Seq.empty,
47-
Compile / packageDoc / publishArtifact := false,
48-
Test / publishArtifact := false,
49-
Test / test / wartremoverErrors := (Compile / compile / wartremoverErrors).value filterNot Set(
50-
Wart.MutableDataStructures,
51-
Wart.OptionPartial,
52-
Wart.AsInstanceOf,
53-
Wart.EitherProjectionPartial
54-
)
33+
Test / publishArtifact := false
5534
)
5635

5736
lazy val microsite: Seq[Def.Setting[_]] = Seq(

project/Dependencies.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ object Dependencies {
1616
val http4sDsl = "org.http4s" %% "http4s-dsl" % Versions.http4s
1717
val http4sServer = "org.http4s" %% "http4s-server" % Versions.http4s
1818
val jsr305 = "com.google.code.findbugs" % "jsr305" % "3.0.2"
19-
val kindProjector = "org.typelevel" %% "kind-projector" % "0.10.3"
19+
val kindProjector = "org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full
2020
val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.3"
2121
val micrometerCore = "io.micrometer" % "micrometer-core" % Versions.micrometerCore
2222
val micrometerJmx = "io.micrometer" % "micrometer-registry-jmx" % Versions.micrometerJmx
2323
val micrometerStatsD = "io.micrometer" % "micrometer-registry-statsd" % Versions.micrometerStatsD
24-
val monixEval = "io.monix" %% "monix-eval" % Versions.monix
2524
val monixCatnap = "io.monix" %% "monix-catnap" % Versions.monix
25+
val monixEval = "io.monix" %% "monix-eval" % Versions.monix
2626
val postgresql = "org.postgresql" % "postgresql" % "42.2.10"
2727
val pureConfig = "com.github.pureconfig" %% "pureconfig" % "0.12.2"
28+
val scalafixScaluzzi = "com.github.vovapolu" %% "scaluzzi" % "0.1.3"
29+
val scalafixSortImports = "com.nequissimus" %% "sort-imports" % "0.3.2"
2830
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.0"
29-
val scalazzi = "com.github.vovapolu" %% "scaluzzi" % "0.1.3"
30-
val sortImports = "com.nequissimus" %% "sort-imports" % "0.3.2"
3131
val silencer = "com.github.ghik" % "silencer-plugin" % Versions.silencer cross CrossVersion.full
3232
val silencerLib = "com.github.ghik" % "silencer-lib" % Versions.silencer cross CrossVersion.full
3333
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.30"

project/plugins.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.10")
22
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.11")
3-
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.3")
43
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")
54
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.2")
65
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.0")

pureconfig/src/main/scala/com/avast/sst/pureconfig/PureConfigModule.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import cats.syntax.either._
66
import pureconfig.error.{ConfigReaderFailure, ConfigReaderFailures, ConvertFailure}
77
import pureconfig.{ConfigReader, ConfigSource}
88

9-
import scala.language.higherKinds
109
import scala.reflect.ClassTag
1110

1211
/** Provides loading of configuration into case class via PureConfig. */

ssl-config/src/main/scala/com/avast/sst/ssl/SslContextModule.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import com.typesafe.sslconfig.ssl.{
1010
}
1111
import javax.net.ssl.{KeyManagerFactory, SSLContext, TrustManagerFactory}
1212

13-
import scala.language.higherKinds
14-
1513
object SslContextModule {
1614

1715
/** Initializes [[javax.net.ssl.SSLContext]] from the provided config.

0 commit comments

Comments
 (0)