Skip to content

Commit

Permalink
scalafix and scalaformat
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed Aug 10, 2023
1 parent bd89b0b commit 2610e22
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ lazy val server = project
"com.typesafe.akka" %% "akka-http-testkit" % V.akkaHttp % Test,
"ch.megard" %% "akka-http-cors" % "1.2.0",
"com.softwaremill.akka-http-session" %% "core" % "0.7.0",
"com.typesafe.akka" %% "akka-http" % V.akkaHttpVersion,
"com.typesafe.akka" %% "akka-http" % V.akkaHttp,
"org.endpoints4s" %% "akka-http-server" % "7.2.0",
"org.webjars" % "bootstrap-sass" % "3.4.1",
"org.webjars" % "bootstrap-switch" % "3.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ object Values {
}

object SbtCrossProject {
val reference = Project.Reference.from("portable-scala", "sbt-crossproject")
val mavenReference = MavenReference("org.portable-scala", "sbt-scalajs-crossproject_2.12_1.0", "1.3.2")
val creationDate = Instant.ofEpochSecond(1688667180L)
val reference: Project.Reference = Project.Reference.from("portable-scala", "sbt-crossproject")
val mavenReference: MavenReference =
MavenReference("org.portable-scala", "sbt-scalajs-crossproject_2.12_1.0", "1.3.2")
val creationDate: Instant = Instant.ofEpochSecond(1688667180L)
}

private def contributor(login: String): GithubContributor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import coursier.Organization
import coursier.Repositories
import coursier.core.Type
import coursier.error.ResolutionError
import scaladex.core.service.PomResolver
import coursier.maven.SbtMavenRepository
import scaladex.core.model.Artifact
import scaladex.core.service.PomResolver

class CoursierResolver(implicit val ec: ExecutionContext) extends PomResolver with LazyLogging {
private val repositories = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import java.time.format.DateTimeFormatter
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.Future
import scala.concurrent.Promise
import scala.util.Failure
import scala.util.Try
import scala.util.control.NonFatal

Expand Down Expand Up @@ -71,10 +70,10 @@ class SonatypeClientImpl()(implicit val system: ActorSystem)
versionParsed = versions.flatMap(SemanticVersion.parse)
} yield versionParsed
future.recoverWith {
case NonFatal(exception) =>
logger.warn(s"failed to retrieve versions from $uri because ${exception.getMessage}")
Future.successful(Nil)
}
case NonFatal(exception) =>
logger.warn(s"failed to retrieve versions from $uri because ${exception.getMessage}")
Future.successful(Nil)
}
}

override def getPomFile(mavenReference: Artifact.MavenReference): Future[Option[(String, Instant)]] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package scaladex.server.route.api

import java.nio.file.Path

import scala.concurrent.duration.DurationInt

import akka.http.scaladsl.model.ContentTypes
Expand All @@ -13,10 +10,10 @@ import org.scalatest.BeforeAndAfterEach
import scaladex.core.model.Env
import scaladex.core.test.MockGithubAuth
import scaladex.core.test.Values._
import scaladex.infra.CoursierResolver
import scaladex.server.route.ControllerBaseSuite
import scaladex.server.route.api.PublishApi
import scaladex.server.service.PublishProcess
import scaladex.infra.CoursierResolver

class PublishApiTests extends ControllerBaseSuite with BeforeAndAfterEach {
val pomResolver = new CoursierResolver
Expand Down Expand Up @@ -94,10 +91,10 @@ class PublishApiTests extends ControllerBaseSuite with BeforeAndAfterEach {
val request = Put(s"/publish?created=$creationDate&path=$pomFile", entity).addCredentials(admin)
request ~> publishApi.routes ~> check {
for (artifacts <- database.getArtifacts(SbtCrossProject.reference))
yield {
val mavenRefs = artifacts.map(_.mavenReference)
mavenRefs should contain theSameElementsAs Seq(SbtCrossProject.mavenReference)
}
yield {
val mavenRefs = artifacts.map(_.mavenReference)
mavenRefs should contain theSameElementsAs Seq(SbtCrossProject.mavenReference)
}
}
}
}

0 comments on commit 2610e22

Please sign in to comment.