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

fail compile on match exhaustiveness warnings #1264

Merged
merged 3 commits into from
Nov 15, 2023
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
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ val commonSettings = Seq(
scalaVersion := "2.13.12",
scalacOptions ++= Seq(
"-feature",
"-language:postfixOps,reflectiveCalls,implicitConversions"
"-language:postfixOps,reflectiveCalls,implicitConversions",
"-Wconf:cat=other-match-analysis:error"
// , "-Xfatal-warnings" TODO: Akka Agents have been deprecated. Once they have been replaced we can re-enable, but that's not trivial
),
Compile / doc / scalacOptions ++= Seq(
Expand Down
2 changes: 1 addition & 1 deletion riff-raff/app/controllers/Testing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class Testing(
Ok(views.html.test.uuidList(config, menu)(request, allDeploys.take(limit)))
}

def S3LatencyList(limit: Int, csv: Boolean) = authAction { implicit request =>
def S3LatencyList(csv: Boolean) = authAction { implicit request =>
val filter = DeployFilter.fromRequest
val pagination = PaginationView.fromRequest
val allDeploys = documentStoreConverter
Expand Down
6 changes: 4 additions & 2 deletions riff-raff/app/utils/Retriable.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package utils

import play.api.Logger
import scala.util.{Try, Success, Failure}
import scala.annotation.tailrec

import scala.util.{Failure, Success, Try}
import scala.annotation.{nowarn, tailrec}

trait Retriable {
def log: Logger

def retryUpTo[T](maxAttempts: Int, message: Option[String] = None)(
thunk: => T
): Try[T] = {
@nowarn // It would fail on the following inputs: Cons(), Empty
@tailrec def go(s: Stream[Try[T]], n: Int): Try[T] = s match {
case (f @ Failure(t)) #:: tail =>
val errorMessage = "Caught exception %s (attempt #%d)".format(
Expand Down
4 changes: 2 additions & 2 deletions riff-raff/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ GET /testing/reportTestPartial controllers.Testing.
GET /testing/form controllers.Testing.form
POST /testing/formPost controllers.Testing.formPost
GET /testing/uuidList controllers.Testing.uuidList(limit:Int ?= 500)
GET /testing/s3Latency controllers.Testing.S3LatencyList(limit:Int ?= 10, csv:Boolean=false)
GET /testing/s3Latency/csv controllers.Testing.S3LatencyList(limit:Int ?= 10, csv:Boolean=true)
GET /testing/s3Latency controllers.Testing.S3LatencyList(csv:Boolean=false)
GET /testing/s3Latency/csv controllers.Testing.S3LatencyList(csv:Boolean=true)
POST /testing/actionUUID controllers.Testing.actionUUID
GET /testing/view/:uuid controllers.Testing.debugLogViewer(uuid)
GET /testing/addStringUUID controllers.Testing.transferAllUUIDs
Expand Down