Skip to content

Commit

Permalink
Merge pull request #937 from armanbilge/update/sbt-typelevel-0.5.0
Browse files Browse the repository at this point in the history
Update to sbt-typelevel 0.5.0
  • Loading branch information
mpilquist authored Aug 15, 2023
2 parents 41a3ac6 + f271cb3 commit b4fe82f
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 164 deletions.
263 changes: 125 additions & 138 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ThisBuild / tlBaseVersion := "0.6"
// Our Scala versions.
lazy val `scala-2.12` = "2.12.17"
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-3.0` = "3.2.2"
lazy val `scala-3.0` = "3.3.0"

ThisBuild / scalaVersion := `scala-2.13`
ThisBuild / crossScalaVersions :=
Expand All @@ -16,14 +16,15 @@ ThisBuild / developers := List(
)

ThisBuild / tlCiReleaseBranches += "series/0.6.x"
ThisBuild / tlCiScalafmtCheck := false
ThisBuild / tlSitePublishBranch := Some("series/0.6.x")
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))
ThisBuild / tlJdkRelease := Some(8)

ThisBuild / githubWorkflowBuildPreamble ++= nativeBrewInstallWorkflowSteps.value
ThisBuild / nativeBrewInstallCond := Some("matrix.project == 'rootNative'")
ThisBuild / nativeBrewInstallCond := Some("matrix.project == 'skunkNative'")

lazy val setupCertAndDocker = Seq(
WorkflowStep.Run(
Expand All @@ -38,15 +39,12 @@ ThisBuild / tlCiHeaderCheck := true
ThisBuild / githubWorkflowAddedJobs +=
WorkflowJob(
id = "coverage",
name = s"Generate coverage report (${`scala-2.13`} JVM only)",
name = s"Generate coverage report (2.13 JVM only)",
scalas = List(`scala-2.13`),
steps = githubWorkflowJobSetup.value.toList ++
List(
WorkflowStep.Sbt(List("coverage", "rootJVM/test", "coverageReport")),
WorkflowStep.Run(
List("bash <(curl -s https://codecov.io/bash)"),
name = Some("Upload code coverage data")
)
WorkflowStep.Sbt(List("coverage", "skunkJVM/test", "coverageReport")),
WorkflowStep.Use(UseRef.Public("codecov", "codecov-action", "v3"))
)
)

Expand Down Expand Up @@ -83,7 +81,7 @@ lazy val commonSettings = Seq(

// Compilation
scalacOptions -= "-language:experimental.macros", // doesn't work cross-version
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings"),
Compile / doc / scalacOptions --= Seq("-Werror"),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
Expand All @@ -110,7 +108,6 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.settings(
name := "skunk-core",
description := "Tagless, non-blocking data access library for Postgres.",
scalacOptions ~= (_.filterNot(_ == "-source:3.0-migration")),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.9.0",
"org.typelevel" %%% "cats-effect" % "3.5.0",
Expand Down Expand Up @@ -170,7 +167,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.enablePlugins(AutomateHeaderPlugin, NoPublishPlugin)
.settings(commonSettings)
.settings(
scalacOptions -= "-Xfatal-warnings",
tlFatalWarnings := false,
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.0-M7",
"org.scalameta" % "junit-interface" % "1.0.0-M7",
Expand Down Expand Up @@ -233,7 +230,14 @@ lazy val docs = project
.enablePlugins(TypelevelSitePlugin)
.settings(commonSettings)
.settings(
scalacOptions ~= {
_.map {
case opt if opt.startsWith("-Xlint") => s"$opt,-missing-interpolator"
case opt => opt
}
},
mdocIn := (Compile / sourceDirectory).value / "laika",
tlSiteIsTypelevelProject := Some(TypelevelProject.Affiliate),
libraryDependencies ++= Seq(
"org.tpolecat" %%% "natchez-jaeger" % natchezVersion,
),
Expand Down
3 changes: 3 additions & 0 deletions modules/core/native/src/main/scala/net/message/openssl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

package skunk.net.message

import org.typelevel.scalaccompat.annotation._

import scala.scalanative.unsafe._

@nowarn212
@link("crypto")
@extern
private[message] object openssl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ object StringContextOps {
}

def identifier_impl(): Tree = {
val Apply(_, List(Apply(_, List(Literal(Constant(part: String)))))) = c.prefix.tree
val Apply(_, List(Apply(_, List(Literal(Constant(part: String)))))) = c.prefix.tree: @unchecked
Identifier.fromString(part) match {
case Left(s) => c.abort(c.enclosingPosition, s)
case Right(Identifier(s)) => q"_root_.skunk.data.Identifier.fromString($s).fold(sys.error, identity)"
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala-3/SqlState.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package skunk

import scala.collection.immutable.IndexedSeq
import skunk.exception.PostgresErrorException

/**
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala-3/util/Twiddler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package skunk
package util

import scala.annotation.implicitNotFound
import scala.quoted._
import scala.deriving.Mirror

import skunk.implicits._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ trait TemporalCodecs {
.optionalStart
.appendFraction(NANO_OF_SECOND, 0, precision, true)
.optionalEnd
()
}

requiredPart.toFormatter(Locale.US)
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala/net/message/Bind.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec._
import scodec.codecs._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.codecs._
import scodec.Encoder

Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala/net/message/Parse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.codecs._
import scodec.Encoder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.Encoder
import scodec.bits.ByteVector
import scodec.codecs.{bytes, int32, variableSizeBytes}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec._
import scodec.codecs._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package protocol
import cats.FlatMap
import cats.syntax.all._
import skunk.net.message.{ Close => CloseMessage, Flush, CloseComplete }
import skunk.net.MessageSocket
import natchez.Trace

trait Close[F[_]] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object Parse {
_ <- Trace[F].put(
"statement-name" -> id.value,
"statement-sql" -> statement.sql,
"statement-parameter-types" -> os.map(n => ty.typeForOid(n, -1).getOrElse(n)).mkString("[", ", ", "]")
"statement-parameter-types" -> os.map(n => ty.typeForOid(n, -1).fold(n.toString)(_.toString)).mkString("[", ", ", "]")
)
_ <- send(ParseMessage(id.value, statement.sql, os))
_ <- send(Flush)
Expand Down
6 changes: 5 additions & 1 deletion modules/core/shared/src/main/scala/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT

package skunk

import cats.effect.Resource
import org.typelevel.scalaccompat.annotation._
import org.typelevel.twiddles.TwiddleCompat

/**
Expand Down Expand Up @@ -123,7 +126,8 @@ import org.typelevel.twiddles.TwiddleCompat
* @groupname Companions Companion Objects
* @groupprio Companions 999
*/
package object skunk extends TwiddleCompat {
@nowarn213("msg=package object inheritance is deprecated")
object `package` extends TwiddleCompat { // aka package object skunk, yes this actually works ...

// we can use this to defeat value discarding warnings for erasable proof terms
private[skunk] def void(a: Any*): Unit = (a, ())._2
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.8.2
sbt.version=1.9.3
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ThisBuild / libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)

addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.20")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.20")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.0-RC11")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.5.0-RC11")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.7")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.12")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.1.3")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.2.0-RC1")

0 comments on commit b4fe82f

Please sign in to comment.