From 21eec6881f69a9a2dce6d6df4502289f86311f78 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 04:53:15 +0000 Subject: [PATCH 01/12] Adopt sbt-circe-org --- .github/workflows/ci.yml | 273 +++++++++++++++++++++++++++++++++++++-- .gitignore | 3 + build.sbt | 128 +----------------- project/build.properties | 2 +- project/plugins.sbt | 14 +- version.sbt | 1 - 6 files changed, 273 insertions(+), 148 deletions(-) delete mode 100644 version.sbt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c3f758..fb8e01c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,17 @@ name: Continuous Integration on: pull_request: - branches: ['**'] + branches: ['**', '!update/**', '!pr/**'] push: - branches: ['**'] + branches: ['**', '!update/**', '!pr/**'] + tags: [v*] env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: @@ -23,7 +29,15 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.12.15, 2.13.8, 3.1.0] - java: [adopt@1.8] + java: [temurin@11, temurin@17] + project: [rootJS, rootJVM] + exclude: + - scala: 2.12.15 + java: temurin@17 + - scala: 2.13.8 + java: temurin@17 + - project: rootJS + java: temurin@17 runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -31,10 +45,37 @@ jobs: with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v13 + - name: Download Java (temurin@11) + id: download-java-temurin-11 + if: matrix.java == 'temurin@11' + uses: typelevel/download-java@v1 with: - java-version: ${{ matrix.java }} + distribution: temurin + java-version: 11 + + - name: Setup Java (temurin@11) + if: matrix.java == 'temurin@11' + uses: actions/setup-java@v2 + with: + distribution: jdkfile + java-version: 11 + jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} + + - name: Download Java (temurin@17) + id: download-java-temurin-17 + if: matrix.java == 'temurin@17' + uses: typelevel/download-java@v1 + with: + distribution: temurin + java-version: 17 + + - name: Setup Java (temurin@17) + if: matrix.java == 'temurin@17' + uses: actions/setup-java@v2 + with: + distribution: jdkfile + java-version: 17 + jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} - name: Cache sbt uses: actions/cache@v2 @@ -49,10 +90,222 @@ jobs: key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date - run: sbt ++${{ matrix.scala }} githubWorkflowCheck + run: sbt githubWorkflowCheck + + - name: Check headers and formatting + if: matrix.java == 'temurin@11' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck + + - name: scalaJSLink + if: matrix.project == 'rootJS' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult - name: Test - run: sbt ++${{ matrix.scala }} clean coverage test coverageReport scalafmtCheckAll + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test + + - name: Check scalafix lints + if: matrix.java == 'temurin@11' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'scalafixAll --check' + + - name: Check binary compatibility + if: matrix.java == 'temurin@11' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues + + - name: Generate API documentation + if: matrix.java == 'temurin@11' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc + + - name: Make target directories + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + run: mkdir -p target .js/target .jvm/target .native/target fs2/.js/target fs2/.jvm/target project/target + + - name: Compress target directories + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + run: tar cf targets.tar target .js/target .jvm/target .native/target fs2/.js/target fs2/.jvm/target project/target + + - name: Upload target directories + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + uses: actions/upload-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} + path: targets.tar + + publish: + name: Publish Artifacts + needs: [build] + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + strategy: + matrix: + os: [ubuntu-latest] + scala: [3.1.0] + java: [temurin@11] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download Java (temurin@11) + id: download-java-temurin-11 + if: matrix.java == 'temurin@11' + uses: typelevel/download-java@v1 + with: + distribution: temurin + java-version: 11 + + - name: Setup Java (temurin@11) + if: matrix.java == 'temurin@11' + uses: actions/setup-java@v2 + with: + distribution: jdkfile + java-version: 11 + jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} - - name: Upload code coverage - uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 + - name: Download Java (temurin@17) + id: download-java-temurin-17 + if: matrix.java == 'temurin@17' + uses: typelevel/download-java@v1 + with: + distribution: temurin + java-version: 17 + + - name: Setup Java (temurin@17) + if: matrix.java == 'temurin@17' + uses: actions/setup-java@v2 + with: + distribution: jdkfile + java-version: 17 + jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Download target directories (2.12.15, rootJS) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJS + + - name: Inflate target directories (2.12.15, rootJS) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.12.15, rootJVM) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJVM + + - name: Inflate target directories (2.12.15, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.13.8, rootJS) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS + + - name: Inflate target directories (2.13.8, rootJS) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.13.8, rootJVM) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM + + - name: Inflate target directories (2.13.8, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (3.1.0, rootJS) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.0-rootJS + + - name: Inflate target directories (3.1.0, rootJS) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (3.1.0, rootJVM) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.0-rootJVM + + - name: Inflate target directories (3.1.0, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + + - name: Import signing key + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' + run: echo $PGP_SECRET | base64 -di | gpg --import + + - name: Import signing key and strip passphrase + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + run: | + echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg + (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) + + - name: Publish + run: sbt '++${{ matrix.scala }}' tlRelease + + coverage: + name: Generate coverage report + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.12.15, 2.13.8] + java: [temurin@11] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (fast) + uses: actions/checkout@v2 + + - name: Download Java (temurin@17) + id: download-java-temurin-17 + if: matrix.java == 'temurin@17' + uses: typelevel/download-java@v1 + with: + distribution: temurin + java-version: 17 + + - name: Setup Java (temurin@17) + if: matrix.java == 'temurin@17' + uses: actions/setup-java@v2 + with: + distribution: jdkfile + java-version: 17 + jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - run: sbt '++${{ matrix.scala }}' coverage rootJVM/test coverageAggregate + + - uses: codecov/codecov-action@v2 + with: + flags: ${{matrix.scala}},${{matrix.java}} diff --git a/.gitignore b/.gitignore index fb70982..fe18dca 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ target/ .classpath .bsp/ tmp/ +.metals +.vscode +metals.sbt diff --git a/build.sbt b/build.sbt index d52ff0f..7015d74 100644 --- a/build.sbt +++ b/build.sbt @@ -1,16 +1,5 @@ -ThisBuild / organization := "io.circe" - -val compilerOptions = Seq( - "-deprecation", - "-encoding", - "UTF-8", - "-feature", - "-language:existentials", - "-language:higherKinds", - "-unchecked", - "-Ywarn-dead-code", - "-Ywarn-numeric-widen" -) +ThisBuild / tlBaseVersion := "0.14" +ThisBuild / circeRootOfCodeCoverage := Some("rootJVM") val circeVersion = "0.15.0-M1" val fs2Version = "3.2.5" @@ -27,56 +16,13 @@ val scala213 = "2.13.8" ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.1.0") -def priorTo2_13(scalaVersion: String): Boolean = - CrossVersion.partialVersion(scalaVersion) match { - case Some((2, minor)) if minor < 13 => true - case _ => false - } - -val baseSettings = Seq( - scalacOptions ++= compilerOptions, - scalacOptions ++= ( - if (priorTo2_13(scalaVersion.value)) - Seq( - "-Xfuture", - "-Yno-adapted-args", - "-Ywarn-unused-import" - ) - else - Seq( - "-Ywarn-unused:imports" - ) - ), - Compile / console / scalacOptions ~= { - _.filterNot(Set("-Ywarn-unused-import")) - }, - Test / console / scalacOptions ~= { - _.filterNot(Set("-Ywarn-unused-import")) - }, - coverageHighlighting := true, - coverageEnabled := (if (scalaVersion.value.startsWith("2.13")) coverageEnabled.value else false), - Compile / scalastyleSources ++= (Compile / unmanagedSourceDirectories).value -) - -val allSettings = baseSettings ++ publishSettings -val noPublishSettings = Seq( - publish := {}, - publishLocal := {}, - publishArtifact := false -) - -val docMappingsApiDir = settingKey[String]("Subdirectory in site target directory for API docs") - -lazy val root = project.in(file(".")).settings(allSettings).settings(noPublishSettings).aggregate(fs2.jvm, fs2.js) +lazy val root = tlCrossRootProject.aggregate(fs2) lazy val fs2 = crossProject(JVMPlatform, JSPlatform) .crossType(CrossType.Pure) .in(file("fs2")) - .settings(allSettings) - .jsSettings(coverageEnabled := false) .settings( - moduleName := "circe-fs2", - mimaPreviousArtifacts := Set("io.circe" %% "circe-fs2" % previousCirceFs2Version), + name := "circe-fs2", libraryDependencies ++= Seq( "co.fs2" %%% "fs2-core" % fs2Version, "io.circe" %%% "circe-jawn" % circeVersion, @@ -87,71 +33,5 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform) "org.typelevel" %%% "cats-effect-testing-scalatest" % catsEffectTestingVersion % Test, "org.typelevel" %%% "scalacheck-effect" % scalacheckEffectVersion % Test, "org.typelevel" %%% "jawn-parser" % jawnVersion - ), - ghpagesNoJekyll := true, - docMappingsApiDir := "api", - addMappingsToSiteDir(Compile / packageDoc / mappings, docMappingsApiDir) - ) - -lazy val publishSettings = Seq( - releaseCrossBuild := true, - releaseVcsSign := true, - releasePublishArtifactsAction := PgpKeys.publishSigned.value, - homepage := Some(url("https://github.com/circe/circe-fs2")), - licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), - publishMavenStyle := true, - Test / publishArtifact := false, - pomIncludeRepository := { _ => false }, - publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) - Some("snapshots".at(nexus + "content/repositories/snapshots")) - else - Some("releases".at(nexus + "service/local/staging/deploy/maven2")) - }, - /* Someday maybe Scaladoc will actually work on package object-only projects. - autoAPIMappings := true, - apiURL := Some(url("https://circe.github.io/circe-fs2/api/")), - */ - scmInfo := Some( - ScmInfo( - url("https://github.com/circe/circe-fs2"), - "scm:git:git@github.com:circe/circe-fs2.git" - ) - ), - developers := List( - Developer( - "travisbrown", - "Travis Brown", - "travisrobertbrown@gmail.com", - url("https://twitter.com/travisbrown") ) ) -) - -credentials ++= ( - for { - username <- Option(System.getenv().get("SONATYPE_USERNAME")) - password <- Option(System.getenv().get("SONATYPE_PASSWORD")) - } yield Credentials( - "Sonatype Nexus Repository Manager", - "oss.sonatype.org", - username, - password - ) -).toSeq - -ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8") -// No auto-publish atm. Remove this line to generate publish stage -ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty -ThisBuild / githubWorkflowBuild := Seq( - WorkflowStep.Sbt( - List("clean", "coverage", "test", "coverageReport", "scalafmtCheckAll"), - id = None, - name = Some("Test") - ), - WorkflowStep.Use( - UseRef.Public("codecov", "codecov-action", "e156083f13aff6830c92fc5faa23505779fbf649"), // v1.2.1 - name = Some("Upload code coverage") - ) -) diff --git a/project/build.properties b/project/build.properties index c8fcab5..8b9a0b0 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.8.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index c4f1eec..a6977ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,12 +1,2 @@ -addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0") -addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0") +addSbtPlugin("io.circe" % "sbt-circe-org" % "0.1.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") diff --git a/version.sbt b/version.sbt deleted file mode 100644 index f3d98ff..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -ThisBuild / version := "0.14.1-SNAPSHOT" From 1128afd8a85101363968b0eae0594f08c7ced930 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 04:57:21 +0000 Subject: [PATCH 02/12] Disable coverage --- .github/workflows/ci.yml | 46 ---------------------------------------- build.sbt | 2 +- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb8e01c..1a08915 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -263,49 +263,3 @@ jobs: - name: Publish run: sbt '++${{ matrix.scala }}' tlRelease - - coverage: - name: Generate coverage report - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.12.15, 2.13.8] - java: [temurin@11] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (fast) - uses: actions/checkout@v2 - - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v1 - with: - distribution: temurin - java-version: 17 - - - name: Setup Java (temurin@17) - if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 - with: - distribution: jdkfile - java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} - - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - run: sbt '++${{ matrix.scala }}' coverage rootJVM/test coverageAggregate - - - uses: codecov/codecov-action@v2 - with: - flags: ${{matrix.scala}},${{matrix.java}} diff --git a/build.sbt b/build.sbt index 7015d74..043f9f0 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ ThisBuild / tlBaseVersion := "0.14" -ThisBuild / circeRootOfCodeCoverage := Some("rootJVM") +ThisBuild / circeRootOfCodeCoverage := None val circeVersion = "0.15.0-M1" val fs2Version = "3.2.5" From 6ef599f37a2aeea04ffe966f1641623161917644 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:03:28 +0000 Subject: [PATCH 03/12] Fix warnings --- .github/workflows/ci.yml | 18 +++++++++--------- build.sbt | 4 +++- .../test/scala/io/circe/fs2/CirceSuite.scala | 2 -- fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala | 3 +++ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a08915..511225f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,13 +28,13 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.13.8, 3.1.0] + scala: [2.12.15, 2.13.8, 3.2.1] java: [temurin@11, temurin@17] project: [rootJS, rootJVM] exclude: - scala: 2.12.15 java: temurin@17 - - scala: 2.13.8 + - scala: 3.2.1 java: temurin@17 - project: rootJS java: temurin@17 @@ -137,7 +137,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [3.1.0] + scala: [2.13.8] java: [temurin@11] runs-on: ${{ matrix.os }} steps: @@ -230,22 +230,22 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (3.1.0, rootJS) + - name: Download target directories (3.2.1, rootJS) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.0-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJS - - name: Inflate target directories (3.1.0, rootJS) + - name: Inflate target directories (3.2.1, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.1.0, rootJVM) + - name: Download target directories (3.2.1, rootJVM) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.0-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJVM - - name: Inflate target directories (3.1.0, rootJVM) + - name: Inflate target directories (3.2.1, rootJVM) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index 043f9f0..a2a1160 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,8 @@ val scalacheckEffectVersion = "1.0.3" val scala212 = "2.12.15" val scala213 = "2.13.8" -ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.1.0") +ThisBuild / scalaVersion := scala213 +ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.2.1") lazy val root = tlCrossRootProject.aggregate(fs2) @@ -26,6 +27,7 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform) libraryDependencies ++= Seq( "co.fs2" %%% "fs2-core" % fs2Version, "io.circe" %%% "circe-jawn" % circeVersion, + "org.typelevel" %% "scalac-compat-annotation" % "0.1.0" % Test, "io.circe" %%% "circe-generic" % circeVersion % Test, "io.circe" %%% "circe-testing" % circeVersion % Test, "org.scalatest" %%% "scalatest" % scalaTestVersion % Test, diff --git a/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala b/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala index a5feb34..b8acb7a 100644 --- a/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala +++ b/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala @@ -13,8 +13,6 @@ import org.scalatestplus.scalacheck.Checkers import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks import org.typelevel.discipline.Laws -import scala.language.implicitConversions - /** * An opinionated stack of traits to improve consistency and reduce boilerplate in circe tests. */ diff --git a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala index 2fd15c9..fc10994 100644 --- a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala +++ b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala @@ -16,9 +16,12 @@ import org.scalatest.compatible.Assertion import org.scalatest.enablers.WheneverAsserting import org.scalatest.exceptions.DiscardedEvaluationException import org.typelevel.jawn.AsyncParser +import org.typelevel.scalaccompat.annotation._ import scala.collection.immutable.{ Stream => StdStream } +@nowarn213 +@nowarn3 class Fs2Suite extends CirceSuite { def fooStream(fooStdStream: StdStream[Foo], fooVector: Vector[Foo]): Stream[IO, Foo] = Stream.emits(fooStdStream).append(Stream.emits(fooVector)) From 7baea14250857fb9787eb704687a4bb673c76b18 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:05:17 +0000 Subject: [PATCH 04/12] Fix mima --- build.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index a2a1160..4446e2e 100644 --- a/build.sbt +++ b/build.sbt @@ -37,3 +37,6 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform) "org.typelevel" %%% "jawn-parser" % jawnVersion ) ) + .jsSettings( + tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.14.1").toMap + ) From b756d96bb0939a0b0f5e61feba946ba19064cf51 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:08:43 +0000 Subject: [PATCH 05/12] headers --- build.sbt | 1 + .../main/scala/io/circe/fs2/ParsingPipe.scala | 16 ++++++++++++++++ fs2/src/main/scala/io/circe/fs2/package.scala | 16 ++++++++++++++++ fs2/src/test/scala/io/circe/fs2/CirceSuite.scala | 16 ++++++++++++++++ fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala | 16 ++++++++++++++++ .../scala/io/circe/fs2/examples/package.scala | 16 ++++++++++++++++ 6 files changed, 81 insertions(+) diff --git a/build.sbt b/build.sbt index 4446e2e..3097765 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,6 @@ ThisBuild / tlBaseVersion := "0.14" ThisBuild / circeRootOfCodeCoverage := None +ThisBuild / startYear := Some(2017) val circeVersion = "0.15.0-M1" val fs2Version = "3.2.5" diff --git a/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala b/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala index b3bc336..3dc41c3 100644 --- a/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala +++ b/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2017 circe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.circe.fs2 import _root_.fs2.{ Chunk, Pipe, Pull, RaiseThrowable, Stream } diff --git a/fs2/src/main/scala/io/circe/fs2/package.scala b/fs2/src/main/scala/io/circe/fs2/package.scala index 70b3b78..03e8af3 100644 --- a/fs2/src/main/scala/io/circe/fs2/package.scala +++ b/fs2/src/main/scala/io/circe/fs2/package.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2017 circe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.circe import _root_.fs2.{ Chunk, Pipe, RaiseThrowable, Stream } diff --git a/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala b/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala index b8acb7a..05acf45 100644 --- a/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala +++ b/fs2/src/test/scala/io/circe/fs2/CirceSuite.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2017 circe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.circe.fs2 import cats.effect.testing.scalatest.AssertingSyntax diff --git a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala index fc10994..278fa4a 100644 --- a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala +++ b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2017 circe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.circe.fs2 import _root_.fs2.Pipe diff --git a/fs2/src/test/scala/io/circe/fs2/examples/package.scala b/fs2/src/test/scala/io/circe/fs2/examples/package.scala index 2be0f50..1082982 100644 --- a/fs2/src/test/scala/io/circe/fs2/examples/package.scala +++ b/fs2/src/test/scala/io/circe/fs2/examples/package.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2017 circe + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.circe.fs2 import cats.Eq From 18030e1d5bac82aae16a843ab66888d76c21238c Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:16:02 +0000 Subject: [PATCH 06/12] Fix some deprecations --- .../test/scala/io/circe/fs2/Fs2Suite.scala | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala index 278fa4a..a131219 100644 --- a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala +++ b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala @@ -80,18 +80,18 @@ class Fs2Suite extends CirceSuite { } "byteArrayParser" should "parse bytes wrapped in array" in { - testParser(AsyncParser.UnwrapArray, _.through(text.utf8Encode).through(byteArrayParser)) + testParser(AsyncParser.UnwrapArray, _.through(text.utf8.encode).through(byteArrayParser)) } "byteStreamParser" should "parse bytes delimited by new lines" in { - testParser(AsyncParser.ValueStream, _.through(text.utf8Encode).through(byteStreamParser)) + testParser(AsyncParser.ValueStream, _.through(text.utf8.encode).through(byteStreamParser)) } "byteParser" should "parse single value" in { PropF.forAllF { (foo: Foo) => val stream = serializeFoos(AsyncParser.SingleValue, Stream.emit(foo)) stream - .through(text.utf8Encode) + .through(text.utf8.encode) .through(byteParser(AsyncParser.SingleValue)) .compile .toVector @@ -105,25 +105,25 @@ class Fs2Suite extends CirceSuite { val stream = serializeFoos(AsyncParser.SingleValue, Stream.emit(foo)) val parseOnce = - stream.through(text.utf8Encode).through(byteParser(AsyncParser.SingleValue)).compile.toVector + stream.through(text.utf8.encode).through(byteParser(AsyncParser.SingleValue)).compile.toVector (parseOnce.attempt >> parseOnce.attempt).map(r => assert(r == Right(Vector(foo.asJson)))) }.check().map(r => assert(r.passed)) } "byteArrayParserC" should "parse bytes wrapped in array" in { - testParser(AsyncParser.UnwrapArray, _.through(text.utf8Encode).chunks.through(byteArrayParserC)) + testParser(AsyncParser.UnwrapArray, _.through(text.utf8.encode).chunks.through(byteArrayParserC)) } "byteStreamParserC" should "parse bytes delimited by new lines" in { - testParser(AsyncParser.ValueStream, _.through(text.utf8Encode).chunks.through(byteStreamParserC)) + testParser(AsyncParser.ValueStream, _.through(text.utf8.encode).chunks.through(byteStreamParserC)) } "byteParserC" should "parse single value" in { PropF.forAllF { (foo: Foo) => val stream = serializeFoos(AsyncParser.SingleValue, Stream.emit(foo)) stream - .through(text.utf8Encode) + .through(text.utf8.encode) .chunks .through(byteParserC(AsyncParser.SingleValue)) .compile @@ -185,19 +185,19 @@ class Fs2Suite extends CirceSuite { } "byteArrayParser" should "return ParsingFailure" in { - testParsingFailure(_.through(text.utf8Encode).through(byteArrayParser)) + testParsingFailure(_.through(text.utf8.encode).through(byteArrayParser)) } "byteStreamParser" should "return ParsingFailure" in { - testParsingFailure(_.through(text.utf8Encode).through(byteStreamParser)) + testParsingFailure(_.through(text.utf8.encode).through(byteStreamParser)) } "byteArrayParserC" should "return ParsingFailure" in { - testParsingFailure(_.through(text.utf8Encode).chunks.through(byteArrayParserC)) + testParsingFailure(_.through(text.utf8.encode).chunks.through(byteArrayParserC)) } "byteStreamParserC" should "return ParsingFailure" in { - testParsingFailure(_.through(text.utf8Encode).chunks.through(byteStreamParserC)) + testParsingFailure(_.through(text.utf8.encode).chunks.through(byteStreamParserC)) } "decoder" should "return DecodingFailure" in From a3ae2d64bc8d65a116a8b2efc5c5d28d51ca0d03 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:18:53 +0000 Subject: [PATCH 07/12] Bump Scala 2.12 --- .github/workflows/ci.yml | 16 ++++++++-------- build.sbt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 511225f..f70c025 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,11 +28,11 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.13.8, 3.2.1] + scala: [2.12.17, 2.13.8, 3.2.1] java: [temurin@11, temurin@17] project: [rootJS, rootJVM] exclude: - - scala: 2.12.15 + - scala: 2.12.17 java: temurin@17 - scala: 3.2.1 java: temurin@17 @@ -190,22 +190,22 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.12.15, rootJS) + - name: Download target directories (2.12.17, rootJS) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJS - - name: Inflate target directories (2.12.15, rootJS) + - name: Inflate target directories (2.12.17, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.15, rootJVM) + - name: Download target directories (2.12.17, rootJVM) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM - - name: Inflate target directories (2.12.15, rootJVM) + - name: Inflate target directories (2.12.17, rootJVM) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index 3097765..3ba94ba 100644 --- a/build.sbt +++ b/build.sbt @@ -12,7 +12,7 @@ val scalaTestPlusVersion = "3.2.11.0" val catsEffectTestingVersion = "1.4.0" val scalacheckEffectVersion = "1.0.3" -val scala212 = "2.12.15" +val scala212 = "2.12.17" val scala213 = "2.13.8" ThisBuild / scalaVersion := scala213 From bdda9473137c2330a2a46b5ad454b17a5e28030e Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:21:44 +0000 Subject: [PATCH 08/12] Bump Scala 2.13 --- .github/workflows/ci.yml | 16 ++++++++-------- build.sbt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f70c025..592f8b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.17, 2.13.8, 3.2.1] + scala: [2.12.17, 2.13.10, 3.2.1] java: [temurin@11, temurin@17] project: [rootJS, rootJVM] exclude: @@ -137,7 +137,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.8] + scala: [2.13.10] java: [temurin@11] runs-on: ${{ matrix.os }} steps: @@ -210,22 +210,22 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.8, rootJS) + - name: Download target directories (2.13.10, rootJS) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJS - - name: Inflate target directories (2.13.8, rootJS) + - name: Inflate target directories (2.13.10, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.8, rootJVM) + - name: Download target directories (2.13.10, rootJVM) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJVM - - name: Inflate target directories (2.13.8, rootJVM) + - name: Inflate target directories (2.13.10, rootJVM) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index 3ba94ba..62e140f 100644 --- a/build.sbt +++ b/build.sbt @@ -13,7 +13,7 @@ val catsEffectTestingVersion = "1.4.0" val scalacheckEffectVersion = "1.0.3" val scala212 = "2.12.17" -val scala213 = "2.13.8" +val scala213 = "2.13.10" ThisBuild / scalaVersion := scala213 ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.2.1") From 17421298eca299692cb82708738aafc4bc5b2020 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:24:35 +0000 Subject: [PATCH 09/12] Bumps --- build.sbt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 62e140f..9252e58 100644 --- a/build.sbt +++ b/build.sbt @@ -7,8 +7,8 @@ val fs2Version = "3.2.5" val jawnVersion = "1.3.2" val previousCirceFs2Version = "0.13.0" -val scalaTestVersion = "3.2.11" -val scalaTestPlusVersion = "3.2.11.0" +val scalaTestVersion = "3.2.14" +val scalaTestPlusVersion = "3.2.14.0" val catsEffectTestingVersion = "1.4.0" val scalacheckEffectVersion = "1.0.3" @@ -32,7 +32,7 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform) "io.circe" %%% "circe-generic" % circeVersion % Test, "io.circe" %%% "circe-testing" % circeVersion % Test, "org.scalatest" %%% "scalatest" % scalaTestVersion % Test, - "org.scalatestplus" %%% "scalacheck-1-15" % scalaTestPlusVersion % Test, + "org.scalatestplus" %%% "scalacheck-1-16" % scalaTestPlusVersion % Test, "org.typelevel" %%% "cats-effect-testing-scalatest" % catsEffectTestingVersion % Test, "org.typelevel" %%% "scalacheck-effect" % scalacheckEffectVersion % Test, "org.typelevel" %%% "jawn-parser" % jawnVersion From 0a6e5f55aec379296c5abed8157b802fd99674a5 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:25:49 +0000 Subject: [PATCH 10/12] nowarn --- build.sbt | 1 - fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 9252e58..5118267 100644 --- a/build.sbt +++ b/build.sbt @@ -28,7 +28,6 @@ lazy val fs2 = crossProject(JVMPlatform, JSPlatform) libraryDependencies ++= Seq( "co.fs2" %%% "fs2-core" % fs2Version, "io.circe" %%% "circe-jawn" % circeVersion, - "org.typelevel" %% "scalac-compat-annotation" % "0.1.0" % Test, "io.circe" %%% "circe-generic" % circeVersion % Test, "io.circe" %%% "circe-testing" % circeVersion % Test, "org.scalatest" %%% "scalatest" % scalaTestVersion % Test, diff --git a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala index a131219..cce6403 100644 --- a/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala +++ b/fs2/src/test/scala/io/circe/fs2/Fs2Suite.scala @@ -32,12 +32,11 @@ import org.scalatest.compatible.Assertion import org.scalatest.enablers.WheneverAsserting import org.scalatest.exceptions.DiscardedEvaluationException import org.typelevel.jawn.AsyncParser -import org.typelevel.scalaccompat.annotation._ +import scala.annotation.nowarn import scala.collection.immutable.{ Stream => StdStream } -@nowarn213 -@nowarn3 +@nowarn class Fs2Suite extends CirceSuite { def fooStream(fooStdStream: StdStream[Foo], fooVector: Vector[Foo]): Stream[IO, Foo] = Stream.emits(fooStdStream).append(Stream.emits(fooVector)) From a4c8a713bdf30e828e7cfbf10cc6bece87d8f962 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:33:26 +0000 Subject: [PATCH 11/12] Scalafix --- .scalafix.conf | 4 ++++ build.sbt | 1 + fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala | 13 ++++++++++--- fs2/src/main/scala/io/circe/fs2/package.scala | 10 +++++++--- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .scalafix.conf diff --git a/.scalafix.conf b/.scalafix.conf new file mode 100644 index 0000000..36159f3 --- /dev/null +++ b/.scalafix.conf @@ -0,0 +1,4 @@ +rules = [ + OrganizeImports +] +OrganizeImports.removeUnused = false diff --git a/build.sbt b/build.sbt index 5118267..324cb8c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,7 @@ ThisBuild / tlBaseVersion := "0.14" ThisBuild / circeRootOfCodeCoverage := None ThisBuild / startYear := Some(2017) +ThisBuild / scalafixScalaBinaryVersion := "2.12" val circeVersion = "0.15.0-M1" val fs2Version = "3.2.5" diff --git a/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala b/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala index 3dc41c3..03534b5 100644 --- a/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala +++ b/fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala @@ -16,11 +16,18 @@ package io.circe.fs2 -import _root_.fs2.{ Chunk, Pipe, Pull, RaiseThrowable, Stream } +import _root_.fs2.Chunk +import _root_.fs2.Pipe +import _root_.fs2.Pull +import _root_.fs2.RaiseThrowable +import _root_.fs2.Stream import cats.effect.Sync -import io.circe.{ Json, ParsingFailure } +import io.circe.Json +import io.circe.ParsingFailure import io.circe.jawn.CirceSupportParser -import org.typelevel.jawn.{ AsyncParser, ParseException } +import org.typelevel.jawn.AsyncParser +import org.typelevel.jawn.ParseException + import scala.collection.Seq private[fs2] abstract class ParsingPipe[F[_]: Sync, S](supportParser: CirceSupportParser) extends Pipe[F, S, Json] { diff --git a/fs2/src/main/scala/io/circe/fs2/package.scala b/fs2/src/main/scala/io/circe/fs2/package.scala index 03e8af3..4d590dd 100644 --- a/fs2/src/main/scala/io/circe/fs2/package.scala +++ b/fs2/src/main/scala/io/circe/fs2/package.scala @@ -16,13 +16,17 @@ package io.circe -import _root_.fs2.{ Chunk, Pipe, RaiseThrowable, Stream } +import _root_.fs2.Chunk +import _root_.fs2.Pipe +import _root_.fs2.RaiseThrowable +import _root_.fs2.Stream +import cats.ApplicativeError import cats.effect.Sync import io.circe.jawn.CirceSupportParser -import org.typelevel.jawn.{ AsyncParser, ParseException } +import org.typelevel.jawn.AsyncParser +import org.typelevel.jawn.ParseException import scala.collection.Seq -import cats.ApplicativeError package object fs2 { private[this] val supportParser: CirceSupportParser = new CirceSupportParser(None, true) From aff02b2ecab6ff7b083173ef2d1046b3c11040af Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 11 Nov 2022 05:36:11 +0000 Subject: [PATCH 12/12] More scalafix --- fs2/src/test/scala/io/circe/fs2/examples/package.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs2/src/test/scala/io/circe/fs2/examples/package.scala b/fs2/src/test/scala/io/circe/fs2/examples/package.scala index 1082982..9154a59 100644 --- a/fs2/src/test/scala/io/circe/fs2/examples/package.scala +++ b/fs2/src/test/scala/io/circe/fs2/examples/package.scala @@ -18,9 +18,12 @@ package io.circe.fs2 import cats.Eq import cats.instances.AllInstances -import io.circe.{ Decoder, Encoder, Json } +import io.circe.Decoder +import io.circe.Encoder +import io.circe.Json import io.circe.testing.ArbitraryInstances -import org.scalacheck.{ Arbitrary, Gen } +import org.scalacheck.Arbitrary +import org.scalacheck.Gen package object examples extends AllInstances with ArbitraryInstances { implicit val eqThrowable: Eq[Throwable] = Eq.fromUniversalEquals