Skip to content

Commit

Permalink
Add scalafmt core as dependency to zio-http-gen
Browse files Browse the repository at this point in the history
This shifts it being downloaded during test execution to download during
sbt init/compile. This should result in more stable tests.
Before downloading scalafmt in ci was flaky
  • Loading branch information
987Nabil committed Dec 24, 2023
1 parent c846a86 commit eeae113
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BuildHelper._
import Dependencies.{scalafmt, _}
import Dependencies._
import sbt.librarymanagement.ScalaArtifacts.isScala3
import scala.concurrent.duration._

Expand Down Expand Up @@ -246,7 +246,8 @@ lazy val zioHttpGen = (project in file("zio-http-gen"))
`zio`,
`zio-test`,
`zio-test-sbt`,
scalafmt.cross(CrossVersion.for3Use2_13),
`scalafmt-dynamic`.cross(CrossVersion.for3Use2_13),
`scalafmt-core`.cross(CrossVersion.for3Use2_13),
),
)
.dependsOn(zioHttp)
Expand Down
3 changes: 2 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ object Dependencies {
val `jwt-core` = "com.github.jwt-scala" %% "jwt-core" % JwtCoreVersion
val `scala-compact-collection` = "org.scala-lang.modules" %% "scala-collection-compat" % ScalaCompactCollectionVersion

val scalafmt = "org.scalameta" %% "scalafmt-dynamic" % "3.7.17"
val `scalafmt-dynamic` = "org.scalameta" %% "scalafmt-dynamic" % "3.7.17"
val `scalafmt-core` = "org.scalameta" %% "scalafmt-core" % "3.7.17"

val netty =
Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package zio.http.gen.scala

import java.io.File
import java.nio.file._

import scala.jdk.CollectionConverters._
Expand Down Expand Up @@ -200,5 +199,5 @@ object CodeGenSpec extends ZIOSpecDefault {
"/GeneratedPaymentNoDiscriminator.scala",
)
},
) @@ java11OrNewer @@ flaky // Downloading scalafmt on CI is flaky
) @@ java11OrNewer
}

0 comments on commit eeae113

Please sign in to comment.