Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable -Xfatal-warnings for Scala 2.13 #909

Merged
merged 2 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import scala.concurrent.duration.TimeUnit
private[handlers] class GrpcServerHandler[F[_]: Sync] private[GrpcServerHandler] ()
extends GrpcServer[GrpcServerOps[F, ?]] {

def start: GrpcServerOps[F, Unit] =
def start(): GrpcServerOps[F, Unit] =
captureWithServer(_.start()).void

def getPort: GrpcServerOps[F, Int] = captureWithServer(_.getPort)
Expand All @@ -43,10 +43,10 @@ private[handlers] class GrpcServerHandler[F[_]: Sync] private[GrpcServerHandler]
def getMutableServices: GrpcServerOps[F, List[ServerServiceDefinition]] =
captureWithServer(_.getMutableServices.asScala.toList)

def shutdown: GrpcServerOps[F, Unit] =
def shutdown(): GrpcServerOps[F, Unit] =
captureWithServer(_.shutdown()).void

def shutdownNow: GrpcServerOps[F, Unit] =
def shutdownNow(): GrpcServerOps[F, Unit] =
captureWithServer(_.shutdownNow()).void

def isShutdown: GrpcServerOps[F, Boolean] = captureWithServer(_.isShutdown)
Expand All @@ -56,7 +56,7 @@ private[handlers] class GrpcServerHandler[F[_]: Sync] private[GrpcServerHandler]
def awaitTerminationTimeout(timeout: Long, unit: TimeUnit): GrpcServerOps[F, Boolean] =
captureWithServer(_.awaitTermination(timeout, unit))

def awaitTermination: GrpcServerOps[F, Unit] = captureWithServer(_.awaitTermination())
def awaitTermination(): GrpcServerOps[F, Unit] = captureWithServer(_.awaitTermination())

private[this] def captureWithServer[A](f: Server => A): GrpcServerOps[F, A] =
Kleisli(s => Sync[F].delay(f(s)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package higherkindness.mu.rpc.server.metrics

import cats.effect.{Clock, IO, Resource}
import cats.effect.{IO, Resource}
import higherkindness.mu.rpc.common.{A => _, _}
import higherkindness.mu.rpc.common.util.FakeClock
import higherkindness.mu.rpc.internal.interceptors.GrpcMethodInfo
Expand Down Expand Up @@ -70,7 +70,6 @@ class MetricsServerInterceptorTests extends RpcBaseTestSuite {
private[this] def makeProtoCalls[A](metricsOps: MetricsOps[IO])(
f: ProtoRPCService[IO] => IO[A]
)(implicit H: ProtoRPCService[IO], clock: FakeClock[IO]): IO[Either[Throwable, A]] = {
implicit val _: Clock[IO] = clock
withServerChannel[IO](
service = ProtoRPCService
.bindService[IO]
Expand Down
5 changes: 4 additions & 1 deletion project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ object ProjectPlugin extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] =
Seq(
crossScalaVersions := Seq(V.scala212, V.scala213),
scalacOptions --= Seq("-Xfuture", "-Xfatal-warnings"),
scalacOptions --= {
if (isOlderScalaVersion(scalaVersion.value)) Seq("-Xfatal-warnings")
else Nil
},
Test / fork := true,
compileOrder in Compile := CompileOrder.JavaThenScala,
coverageFailOnMinimum := false,
Expand Down