From d807ca186f7a7d2cc09422f6f3d40236c92a0493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fede=20Fern=C3=A1ndez?= <720923+fedefernandez@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:22:12 +0100 Subject: [PATCH] bump plugins (#886) --- .scalafmt.conf | 6 ++++++ .../scala-3/github4s/ArbitraryDerivation.scala | 17 ++++++++++------- project/plugins.sbt | 14 +++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 672e2294..a5024346 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -7,6 +7,12 @@ runner { dialect = scala213 } +fileOverride { + "glob:**/github4s/shared/src/test/scala-3/**" { + runner.dialect = scala3 + } +} + continuationIndent.callSite = 2 newlines { diff --git a/github4s/shared/src/test/scala-3/github4s/ArbitraryDerivation.scala b/github4s/shared/src/test/scala-3/github4s/ArbitraryDerivation.scala index 8621aaf9..81bd2e99 100644 --- a/github4s/shared/src/test/scala-3/github4s/ArbitraryDerivation.scala +++ b/github4s/shared/src/test/scala-3/github4s/ArbitraryDerivation.scala @@ -9,7 +9,6 @@ object ArbitraryDerivation { self => object semiauto: extension (A: Arbitrary.type) inline def derived[A]: Arbitrary[A] = - import auto.given summonInline[Arbitrary[A]] inline def deriveArb[A](using g: K0.Generic[A]): Arbitrary[A] = @@ -26,20 +25,24 @@ object ArbitraryDerivation { self => // https://scastie.scala-lang.org/b8CXWfmXQUClqXplyA6TJg opaque type DerivedGen[A] = Gen[A] object DerivedGen extends DerivedGenInstances: - given [A]: Conversion[Gen[A], DerivedGen[A]] = identity + given [A]: Conversion[Gen[A], DerivedGen[A]] = identity extension [A](gen: DerivedGen[A]) def arb: Arbitrary[A] = Arbitrary(gen) private final class ArrayProduct(elems: Array[Any]) extends Product: - def canEqual(that: Any): Boolean = true - def productElement(n: Int): Any = elems(n) - def productArity: Int = elems.length + def canEqual(that: Any): Boolean = true + def productElement(n: Int): Any = elems(n) + def productArity: Int = elems.length override def productIterator: Iterator[Any] = elems.iterator def product[A](arbs: Seq[Arbitrary[_]])(using gen: K0.ProductGeneric[A]): DerivedGen[A] = - Gen.sequence[Array[Any], Any](arbs.map(_.arbitrary)).map(arr => gen.fromProduct(ArrayProduct(arr)).asInstanceOf[A]) + Gen + .sequence[Array[Any], Any](arbs.map(_.arbitrary)) + .map(arr => gen.fromProduct(ArrayProduct(arr)).asInstanceOf[A]) def coproduct[A](arbs: => IndexedSeq[Arbitrary[_ <: A]]): DerivedGen[A] = - Gen.lzy(if arbs.isEmpty then Gen.fail else Gen.choose(0, arbs.length - 1).flatMap(arbs(_).arbitrary)) + Gen.lzy( + if arbs.isEmpty then Gen.fail else Gen.choose(0, arbs.length - 1).flatMap(arbs(_).arbitrary) + ) sealed abstract class DerivedGenInstances: inline def summonAllArb[A, U](using gen: K0.Generic[A]): IndexedSeq[Arbitrary[_ <: U]] = diff --git a/project/plugins.sbt b/project/plugins.sbt index 77c9b049..16419699 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,14 +5,14 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12" addSbtPlugin("com.47deg" % "sbt-microsites" % "1.4.3") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.8") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.4.0") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") addSbtPlugin("com.alejandrohdezma" % "sbt-codecov" % "0.2.1") -addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.11.6") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.6") -addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.6") +addSbtPlugin("com.alejandrohdezma" % "sbt-github" % "0.11.11") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.11.11") +addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.11") addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.4") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0")