~jan0sch/smederee

Showing details for patch 38f99902c1056d24cd1d3166943a694679d114aa.
2023-03-20 (Mon), 8:11 AM - Jens Grassel - 38f99902c1056d24cd1d3166943a694679d114aa

Code Cleanup

- remove unused imports
- remove unused variables
Summary of changes
20 files modified with 4 lines added and 51 lines removed
  • modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala with 0 added and 4 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala with 0 added and 3 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieAccountManagementRepositoryTest.scala with 0 added and 4 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala with 0 added and 5 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala with 0 added and 5 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala with 0 added and 4 removed lines
  • modules/hub/src/it/scala/de/smederee/ssh/SshServerProviderTest.scala with 0 added and 3 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/Account.scala with 0 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/HubServer.scala with 0 added and 2 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/SessionHelpers.scala with 0 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala with 0 added and 4 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/types.scala with 0 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala with 1 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/DoobieSshAuthenticationRepository.scala with 0 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/SshAuthenticator.scala with 0 added and 2 removed lines
  • modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala with 1 added and 3 removed lines
  • modules/hub/src/main/scala/de/smederee/tickets/MilestoneRoutes.scala with 1 added and 4 removed lines
  • modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala with 1 added and 1 removed lines
  • modules/hub/src/test/scala/de/smederee/hub/VcsRepositoryPatchMetadataTest.scala with 0 added and 1 removed lines
  • modules/hub/src/test/scala/de/smederee/ssh/PublicSshKeyTest.scala with 0 added and 1 removed lines
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -18,7 +18,6 @@
 package de.smederee.hub
 
 import java.time._
-import java.util.UUID
 
 import cats.effect._
 import cats.syntax.all._
@@ -26,11 +25,8 @@
 import de.smederee.hub.config._
 import de.smederee.security._
 import doobie._
-import org.flywaydb.core.Flyway
 import org.http4s._
 
-import munit._
-
 final class AuthenticationMiddlewareTest extends BaseSpec with AuthenticationMiddleware {
   test("extractSessionId must return the session id") {
     (genSignAndValidate.sample, genSessionId.sample) match {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -19,9 +19,6 @@
 
 import cats.effect._
 import cats.syntax.all._
-import org.flywaydb.core.Flyway
-
-import munit._
 
 final class DatabaseMigratorTest extends BaseSpec {
   override def beforeEach(context: BeforeEach): Unit = {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAccountManagementRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAccountManagementRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAccountManagementRepositoryTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAccountManagementRepositoryTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -23,13 +23,9 @@
 import cats.effect._
 import cats.syntax.all._
 import de.smederee.hub.Generators._
-import de.smederee.hub.config.SmedereeHubConfig
 import de.smederee.security._
 import de.smederee.ssh._
 import doobie._
-import org.flywaydb.core.Flyway
-
-import munit._
 
 final class DoobieAccountManagementRepositoryTest extends BaseSpec {
   val sshKeyWithComment = ResourceSuiteLocalFixture(
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -17,18 +17,13 @@
 
 package de.smederee.hub
 
-import java.util.UUID
-
 import cats.effect._
 import cats.syntax.all._
 import de.smederee.hub.Generators._
-import de.smederee.hub.config.SmedereeHubConfig
 import de.smederee.security._
 import doobie._
 import org.flywaydb.core.Flyway
 
-import munit._
-
 final class DoobieAuthenticationRepositoryTest extends BaseSpec {
   override def beforeEach(context: BeforeEach): Unit = {
     val dbConfig = configuration.database
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -17,16 +17,11 @@
 
 package de.smederee.hub
 
-import java.util.UUID
-
 import cats.effect._
 import cats.syntax.all._
 import de.smederee.hub.Generators._
 import de.smederee.security._
 import doobie._
-import org.flywaydb.core.Flyway
-
-import munit._
 
 final class DoobieSignupRepositoryTest extends BaseSpec {
   test("createAccount must create a new account") {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -22,14 +22,10 @@
 import de.smederee.email.EmailAddress
 import de.smederee.hub.Generators._
 import de.smederee.hub.VcsMetadataRepositoriesOrdering._
-import de.smederee.hub.config.SmedereeHubConfig
 import de.smederee.security._
 import doobie._
-import org.flywaydb.core.Flyway
 import org.http4s.implicits._
 
-import munit._
-
 import scala.collection.immutable.Queue
 
 final class DoobieVcsMetadataRepositoryTest extends BaseSpec {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/ssh/SshServerProviderTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/ssh/SshServerProviderTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/ssh/SshServerProviderTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/ssh/SshServerProviderTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -20,13 +20,10 @@
 import java.nio.file._
 
 import cats.effect._
-import cats.syntax.all._
 import com.comcast.ip4s._
 import de.smederee.hub.BaseSpec
 import de.smederee.hub.config._
 
-import munit._
-
 final class SshServerProviderTest extends BaseSpec {
 
   val repositoriesDirectory = ResourceSuiteLocalFixture(
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/Account.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/Account.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/Account.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/Account.scala	2025-01-31 10:54:08.591771824 +0000
@@ -20,7 +20,6 @@
 import java.nio.charset.StandardCharsets
 
 import cats._
-import cats.data._
 import cats.syntax.all._
 import de.smederee.email.EmailAddress
 import de.smederee.security._
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala	2025-01-31 10:54:08.591771824 +0000
@@ -24,7 +24,6 @@
 import cats.arrow.FunctionK
 import cats.effect._
 import cats.syntax.all._
-import com.comcast.ip4s._
 import com.typesafe.config._
 import de.smederee.darcs._
 import de.smederee.email.SimpleJavaMailMiddleware
@@ -37,7 +36,6 @@
 import de.smederee.tickets._
 import doobie._
 import org.http4s._
-import org.http4s.dsl.io._
 import org.http4s.ember.server._
 import org.http4s.implicits._
 import org.http4s.server._
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/SessionHelpers.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/SessionHelpers.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/SessionHelpers.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/SessionHelpers.scala	2025-01-31 10:54:08.591771824 +0000
@@ -18,7 +18,6 @@
 package de.smederee.hub
 
 import java.time._
-import java.time.format.DateTimeFormatter
 
 import cats.syntax.all._
 import de.smederee.hub.config.{ AuthenticationTimeouts, Constants }
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/types.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/types.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/types.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/types.scala	2025-01-31 10:54:08.591771824 +0000
@@ -22,7 +22,6 @@
 
 import cats.Eq
 import cats.syntax.all._
-import de.smederee.security.SignedToken
 
 import scala.util.matching.Regex
 
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-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-31 10:54:08.591771824 +0000
@@ -31,9 +31,6 @@
 import de.smederee.hub.forms.types.FormErrors
 import de.smederee.html.LinkTools._
 import de.smederee.security.{ CsrfToken, Username }
-import de.smederee.ssh._
-import org.commonmark.parser.Parser
-import org.commonmark.renderer.html.HtmlRenderer
 import org.fusesource.jansi.utils.UtilsAnsiHtml
 import org.http4s._
 import org.http4s.dsl.Http4sDsl
@@ -42,7 +39,6 @@
 import org.http4s.implicits._
 import org.http4s.twirl.TwirlInstances._
 import org.slf4j.LoggerFactory
-import os.{ /, GlobSyntax }
 
 /** Routes for handling VCS repositories, including creation, management and public serving.
   *
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala	2025-01-31 10:54:08.591771824 +0000
@@ -17,7 +17,7 @@
 
 package de.smederee.ssh
 
-import java.io.{ File, InputStream, OutputStream }
+import java.io.{ InputStream, OutputStream }
 import java.nio.file.Paths
 
 import cats._
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DoobieSshAuthenticationRepository.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DoobieSshAuthenticationRepository.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DoobieSshAuthenticationRepository.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DoobieSshAuthenticationRepository.scala	2025-01-31 10:54:08.591771824 +0000
@@ -23,7 +23,6 @@
 import de.smederee.hub._
 import de.smederee.security.{ UserId, Username }
 import doobie._
-import doobie.Fragments._
 import doobie.implicits._
 import doobie.postgres.implicits._
 import org.slf4j.LoggerFactory
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshAuthenticator.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshAuthenticator.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshAuthenticator.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshAuthenticator.scala	2025-01-31 10:54:08.591771824 +0000
@@ -24,7 +24,6 @@
 import cats.effect.std.Dispatcher
 import cats.effect.unsafe.implicits.global
 import cats.syntax.all._
-import org.apache.sshd.common.config.keys.AuthorizedKeyEntry
 import org.apache.sshd.common.config.keys.KeyUtils
 import org.apache.sshd.common.config.keys.PublicKeyEntryResolver
 import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator
@@ -32,7 +31,6 @@
 import org.slf4j.LoggerFactory
 
 import scala.jdk.CollectionConverters._
-import scala.util.Try
 
 /** A custom PublickeyAuthenticator implementation for restricting access via ssh.
   *
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-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/tickets/LabelRoutes.scala	2025-01-31 10:54:08.591771824 +0000
@@ -25,15 +25,13 @@
 import de.smederee.html._
 import de.smederee.hub.RequestHelpers.instances.given
 import de.smederee.hub.Account
-import de.smederee.security.{ CsrfToken, UserId, Username }
-import de.smederee.tickets.Project
+import de.smederee.security.{ CsrfToken, Username }
 import de.smederee.tickets.config._
 import de.smederee.tickets.forms.types._
 import org.http4s._
 import org.http4s.dsl.Http4sDsl
 import org.http4s.dsl.impl._
 import org.http4s.headers.Location
-import org.http4s.implicits._
 import org.http4s.twirl.TwirlInstances._
 import org.slf4j.LoggerFactory
 
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/tickets/MilestoneRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/tickets/MilestoneRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/tickets/MilestoneRoutes.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/tickets/MilestoneRoutes.scala	2025-01-31 10:54:08.591771824 +0000
@@ -25,15 +25,12 @@
 import de.smederee.html._
 import de.smederee.hub.Account
 import de.smederee.hub.RequestHelpers.instances.given
-import de.smederee.security.{ CsrfToken, UserId, Username }
-import de.smederee.tickets.Project
+import de.smederee.security.{ CsrfToken, Username }
 import de.smederee.tickets.config._
 import de.smederee.tickets.forms.types._
 import org.http4s._
 import org.http4s.dsl.Http4sDsl
-import org.http4s.dsl.impl._
 import org.http4s.headers.Location
-import org.http4s.implicits._
 import org.http4s.twirl.TwirlInstances._
 import org.slf4j.LoggerFactory
 
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-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/SessionHelpersTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -22,7 +22,7 @@
 import de.smederee.hub.Generators.given
 import de.smederee.hub.SessionHelpers.instances._
 import de.smederee.hub.config.{ AuthenticationTimeouts, Constants }
-import de.smederee.security.{ SignAndValidate, SignedToken }
+import de.smederee.security.SignAndValidate
 import org.http4s.{ HttpDate, SameSite }
 
 import munit._
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/hub/VcsRepositoryPatchMetadataTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/hub/VcsRepositoryPatchMetadataTest.scala
--- old-smederee/modules/hub/src/test/scala/de/smederee/hub/VcsRepositoryPatchMetadataTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/VcsRepositoryPatchMetadataTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -18,7 +18,6 @@
 package de.smederee.hub
 
 import cats.syntax.all._
-import de.smederee.hub.Generators.given
 
 import munit._
 import org.scalacheck._
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/ssh/PublicSshKeyTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/ssh/PublicSshKeyTest.scala
--- old-smederee/modules/hub/src/test/scala/de/smederee/ssh/PublicSshKeyTest.scala	2025-01-31 10:54:08.587771816 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/ssh/PublicSshKeyTest.scala	2025-01-31 10:54:08.591771824 +0000
@@ -20,7 +20,6 @@
 import java.time.{ OffsetDateTime, ZoneOffset }
 import java.util.UUID
 
-import de.smederee.hub._
 import de.smederee.security._
 
 import munit._