Skip to content

Commit

Permalink
Merge pull request #572 from danicheg/merge-series/1.x-into-main
Browse files Browse the repository at this point in the history
Merge `series/1.x` into main
  • Loading branch information
rossabaker authored Dec 30, 2021
2 parents 1eb630a + a8c815a commit 7c567e1
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 34 deletions.
68 changes: 52 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.7, 2.12.15, 3.0.2]
java: [adopt@1.8, adopt@1.11]
java: [temurin@8, temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 8

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Cache sbt
uses: actions/cache@v2
Expand Down Expand Up @@ -78,18 +87,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.7]
java: [adopt@1.8]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 11

- name: Cache sbt
uses: actions/cache@v2
Expand Down Expand Up @@ -161,18 +179,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.7, 2.12.15]
java: [adopt@1.8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 8

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Cache sbt
uses: actions/cache@v2
Expand All @@ -195,18 +222,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.12.15]
java: [adopt@1.8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 11

- name: Cache sbt
uses: actions/cache@v2
Expand Down
5 changes: 5 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
updates.pin = [
# Pin to Scala 3.0
{ groupId = "org.scala-lang", artifactId = "scala-library", version = "3.0." },
{ groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.0." },
]
6 changes: 4 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tune this file as appropriate to your style! see:
# https://scalameta.org/scalafmt/docs/configuration.html

version = 2.7.5
version = 3.3.0

maxColumn = 100

Expand All @@ -20,9 +20,11 @@ align {
tokens = ["%", "%%"]
}

docstrings = JavaDoc
docstrings.style = Asterisk

rewrite {
rules = [SortImports, RedundantBraces]
redundantBraces.maxLines = 1
}

runner.dialect = "scala213source3"
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ThisBuild / scalaVersion := Scala213
ThisBuild / publishFullName := "Christopher Davenport"
ThisBuild / publishGithubUser := "christopherdavenport"

ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8", "adopt@1.11")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"), JavaSpec.temurin("11"))

ThisBuild / versionIntroduced := Map(
"2.12" -> "1.2.0",
Expand Down Expand Up @@ -66,7 +66,7 @@ ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("release")
)
) ++ micrositeWorkflowSteps(Some(MicrositesCond)).toSeq :+ WorkflowStep.Sbt(
) ++ micrositeWorkflowSteps(Some(MicrositesCond)) :+ WorkflowStep.Sbt(
List("docs/publishMicrosite"),
cond = Some(MicrositesCond)
)
Expand All @@ -75,7 +75,7 @@ val catsV = "2.7.0"
val catsEffectV = "3.3.1"
val slf4jV = "1.7.32"
val munitCatsEffectV = "1.0.7"
val logbackClassicV = "1.2.8"
val logbackClassicV = "1.2.10"

Global / onChangedBuildSource := ReloadOnSourceChanges

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ import cats.syntax.all._
import org.typelevel.log4cats._

/**
* >>> WARNING READ BEFORE USAGE! <<<
* This logger will NOT log anything if `F` fails!
* >>> WARNING READ BEFORE USAGE! <<< This logger will NOT log anything if `F` fails!
*
* Running the `WriterT` instance will yield a value of type `F[(G[LogMessage], A)]`.
* As a result, the logged messages can be materialized if and only `F` succeeds.
* Running the `WriterT` instance will yield a value of type `F[(G[LogMessage], A)]`. As a result,
* the logged messages can be materialized if and only `F` succeeds.
*/
object WriterTLogger {
def apply[F[_]: Applicative, G[_]: Alternative](
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.5.7
sbt.version=1.5.8
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.5")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24")
addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.22.1")
addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.23.0")
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import scala.reflect.macros.blackbox
/**
* Macros that support the logging system.
*
* See for handling call-by-name-parameters in macros
* https://issues.scala-lang.org/browse/SI-5778
* See for handling call-by-name-parameters in macros https://issues.scala-lang.org/browse/SI-5778
*
* @author Sarah Gerweck <sarah@atscale.com>
* @author
* Sarah Gerweck <sarah@atscale.com>
*/
private[slf4j] class GetLoggerMacros(val c: blackbox.Context) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ private[slf4j] object Slf4jLoggerInternal {
} MDC.put(k, v)

try logging()
finally if (backup eq null) MDC.clear()
else MDC.setContextMap(backup)
finally
if (backup eq null) MDC.clear()
else MDC.setContextMap(backup)
}

isEnabled.ifM(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.log4cats.testing

import org.typelevel.log4cats.{SelfAwareLogger}
import org.typelevel.log4cats.SelfAwareLogger
import cats.effect.Sync
import cats.implicits._
import java.util.concurrent.atomic.AtomicReference
Expand Down

0 comments on commit 7c567e1

Please sign in to comment.