~jan0sch/smederee

Showing details for patch 0012ab8d26f6b21401c655adecb654ae9fa715bb.
2023-05-11 (Thu), 8:00 AM - Jens Grassel - 0012ab8d26f6b21401c655adecb654ae9fa715bb

Compiler flags: re-enable some linter warnings.

- clean up some warnings
Summary of changes
5 files modified with 9 lines added and 9 lines removed
  • build.sbt with 3 added and 3 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/AuthenticationRoutes.scala with 2 added and 2 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala with 2 added and 2 removed lines
  • modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala with 1 added and 1 removed lines
  • modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala with 1 added and 1 removed lines
diff -rN -u old-smederee/build.sbt new-smederee/build.sbt
--- old-smederee/build.sbt	2025-01-30 22:39:40.479970410 +0000
+++ new-smederee/build.sbt	2025-01-30 22:39:40.479970410 +0000
@@ -28,10 +28,10 @@
         "-Wunused:imports", // Warn on unused imports including given and wildcard imports.
         "-Wunused:linted",
         "-Wunused:locals",
-        //"-Wunused:params",
+        "-Wunused:params",
         "-Wunused:privates",
-        //"-Wunused:unsafe-warn-patvars",
-        //"-Wvalue-discard", // TODO: Evaluate and apply if possible.
+        "-Wunused:unsafe-warn-patvars",
+        "-Wvalue-discard",
         //"-Xfatal-warnings", // FIXME: Make this work despite of Twirl!
         "-Ykind-projector",
     ),
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/AuthenticationRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/AuthenticationRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/AuthenticationRoutes.scala	2025-01-30 22:39:40.479970410 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/AuthenticationRoutes.scala	2025-01-30 22:39:40.479970410 +0000
@@ -162,7 +162,7 @@
   }
 
   private val parseLoginFormForLoggedInUsers: AuthedRoutes[Account, F] = AuthedRoutes.of {
-    case ar @ POST -> Root / "login" as _ =>
+    case _ @POST -> Root / "login" as _ =>
       SeeOther(Location(Uri(path = Uri.Path.Root))) // Redirect already logged in users.
   }
 
@@ -185,7 +185,7 @@
   }
 
   private val showLoginFormForLoggedInUsers: AuthedRoutes[Account, F] = AuthedRoutes.of {
-    case ar @ GET -> Root / "login" as _ =>
+    case _ @GET -> Root / "login" as _ =>
       SeeOther(Location(Uri(path = Uri.Path.Root))) // Redirect already logged in users.
   }
 
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-30 22:39:40.479970410 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-30 22:39:40.479970410 +0000
@@ -814,8 +814,8 @@
         )
         _ <- Sync[F].delay(log.info(s"Repository $repo ($requestedFilePath) is cloned."))
         resp <- (repo, requestedFilePath) match {
-          case (Some(repo), Some(path)) => StaticFile.fromPath(path, req.some).getOrElseF(NotFound())
-          case _                        => NotFound()
+          case (Some(_), Some(path)) => StaticFile.fromPath(path, req.some).getOrElseF(NotFound())
+          case _                     => NotFound()
         }
       } yield resp
   }
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala	2025-01-30 22:39:40.479970410 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala	2025-01-30 22:39:40.479970410 +0000
@@ -411,7 +411,7 @@
           case _                    => Sync[F].delay(None)
         }
         resp <- (projectAndId, label) match {
-          case (Some(project, projectId), Some(label)) =>
+          case (Some(project, _), Some(label)) =>
             for {
               projectBaseUri <- Sync[F].delay(
                 linkConfig.createFullUri(
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala
--- old-smederee/modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala	2025-01-30 22:39:40.479970410 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala	2025-01-30 22:39:40.479970410 +0000
@@ -62,7 +62,7 @@
         // The function uses `ZonedDateTime.now(ZoneOffset.UTC)` inside, therefore we can only check
         // if the expiration date stored in the cookie is at least "later" than the current datetime.
         (expires, obtained.expires) match {
-          case (Some(duration), Some(expiration)) =>
+          case (Some(_), Some(expiration)) =>
             HttpDate.fromZonedDateTime(ZonedDateTime.now(ZoneOffset.UTC)).foreach { httpDate =>
               assert(expiration.compareTo(httpDate) > 0)
             }