Skip to content

Commit

Permalink
Merge branch 'series/0.6.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Aug 16, 2023
2 parents 47d2a4f + 4ebff30 commit 1a583aa
Show file tree
Hide file tree
Showing 18 changed files with 156 additions and 166 deletions.
237 changes: 113 additions & 124 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "3.7.9"
version = "3.7.12"
runner.dialect = Scala213Source3
project.includePaths = [] # disables formatting
44 changes: 24 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ThisBuild / tlBaseVersion := "1.0"

// Our Scala versions.
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-2.13` = "2.13.11"
lazy val `scala-3` = "3.3.0"

ThisBuild / scalaVersion := `scala-2.13`
Expand All @@ -14,14 +14,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 @@ -36,15 +37,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 All @@ -59,7 +57,7 @@ ThisBuild / mimaBinaryIssueFilters ++= List(
)

// This is used in a couple places
lazy val fs2Version = "3.7.0"
lazy val fs2Version = "3.8.0"
lazy val openTelemetryVersion = "1.28.0"
lazy val otel4sVersion = "0.2.1"

Expand All @@ -82,7 +80,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 @@ -109,10 +107,9 @@ 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",
"org.typelevel" %%% "cats-core" % "2.10.0",
"org.typelevel" %%% "cats-effect" % "3.5.1",
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
"org.scodec" %%% "scodec-bits" % "1.1.37",
Expand All @@ -122,7 +119,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"org.tpolecat" %%% "sourcepos" % "1.1.0",
"org.typelevel" %%% "twiddles-core" % "0.6.0",
) ++ Seq(
"com.beachape" %%% "enumeratum" % "1.7.2",
"com.beachape" %%% "enumeratum" % "1.7.3",
).filterNot(_ => tlIsScala3.value)
).jvmSettings(
libraryDependencies += "com.ongres.scram" % "client" % "2.1",
Expand Down Expand Up @@ -168,14 +165,14 @@ 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",
"org.scalameta" %%% "munit" % "1.0.0-M8",
"org.scalameta" % "junit-interface" % "1.0.0-M8",
"org.typelevel" %%% "scalacheck-effect-munit" % "2.0.0-M2",
"org.typelevel" %%% "munit-cats-effect" % "2.0.0-M3",
"org.typelevel" %%% "cats-free" % "2.9.0",
"org.typelevel" %%% "cats-laws" % "2.9.0",
"org.typelevel" %%% "cats-free" % "2.10.0",
"org.typelevel" %%% "cats-laws" % "2.10.0",
"org.typelevel" %%% "discipline-munit" % "2.0.0-M3",
"org.typelevel" %%% "cats-time" % "0.5.1",
),
Expand Down Expand Up @@ -204,7 +201,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
.nativeEnablePlugins(ScalaNativeBrewedConfigPlugin)
.nativeSettings(
libraryDependencies += "com.armanbilge" %%% "epollcat" % "0.1.4",
libraryDependencies += "com.armanbilge" %%% "epollcat" % "0.1.5",
Test / nativeBrewFormulas ++= Set("s2n", "utf8proc"),
Test / envVars ++= Map("S2N_DONT_MLOCK" -> "1")
)
Expand Down Expand Up @@ -246,7 +243,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),
laikaConfig := {
import laika.rewrite.link._

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
4 changes: 2 additions & 2 deletions modules/core/shared/src/main/scala/data/Arr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ final class Arr[A] private (
) {

// Data and extent must be consistent. Should be guaranteed but let's check anyway.
assert((data.isEmpty && extent.isEmpty) || (data.length == extent.product))
assert((data.isEmpty && extent.isEmpty) || (data.length == wrapIntArray(extent).product))

// In order to access elements we need the offsets associated with each dimension. But let's not
// compute it unless we need to since these will be constructed in a tight loop when we unroll
// a resultset that contains array columns.
private lazy val _offsets: Array[Int] =
extent.tails.map(_.product).drop(1).toArray
extent.tails.map(wrapIntArray(_).product).drop(1).toArray

/**
* Attempt to reshape this `Arr` with the specified dimensions. This is possible if and only if
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 org.typelevel.otel4s.Attribute
import org.typelevel.otel4s.trace.Span
import org.typelevel.otel4s.trace.Tracer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object Parse {
_ <- span.addAttributes(
Attribute("statement-name", id.value),
Attribute("statement-sql", statement.sql),
Attribute("statement-parameter-types", os.map(n => ty.typeForOid(n, -1).getOrElse(n)).mkString("[", ", ", "]"))
Attribute("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
13 changes: 5 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ ThisBuild / libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)

addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.21")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.21")
addSbtPlugin("com.github.sbt" % "sbt-site" % "1.5.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.0-RC12")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.5.0-RC12")
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.scoverage" % "sbt-scoverage" % "2.0.8")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.12")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.1.3")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.2.0-RC1")

0 comments on commit 1a583aa

Please sign in to comment.