From 8473f1750bd2403599efce60bdde4353ad89d0e1 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 15:40:11 +0400 Subject: [PATCH 1/8] Add .scalafix.conf --- .scalafix.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .scalafix.conf diff --git a/.scalafix.conf b/.scalafix.conf new file mode 100644 index 000000000..44c071e06 --- /dev/null +++ b/.scalafix.conf @@ -0,0 +1,15 @@ +rules = [ + Http4sFs2Linters + Http4sGeneralLinters + Http4sUseLiteralsSyntax + LeakingImplicitClassVal + ExplicitResultTypes + OrganizeImports +] + +triggered.rules = [ + Http4sFs2Linters + Http4sGeneralLinters + Http4sUseLiteralsSyntax + LeakingImplicitClassVal +] \ No newline at end of file From 877d83bba251881aa2ec2a9af20f647596df70fb Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 15:41:08 +0400 Subject: [PATCH 2/8] Add .scalafix.test.conf --- .scalafix.test.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .scalafix.test.conf diff --git a/.scalafix.test.conf b/.scalafix.test.conf new file mode 100644 index 000000000..529257ad8 --- /dev/null +++ b/.scalafix.test.conf @@ -0,0 +1,12 @@ +rules = [ + Http4sGeneralLinters + Http4sUseLiteralsSyntax + LeakingImplicitClassVal + OrganizeImports +] + +triggered.rules = [ + Http4sGeneralLinters + Http4sUseLiteralsSyntax + LeakingImplicitClassVal +] \ No newline at end of file From 8d3b1510dd831bf00fe1697f9e9aa334bc4f2c23 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 15:43:35 +0400 Subject: [PATCH 3/8] Bump sbt-http4s-org version --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 6dbbd3e05..02decfee4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") -addSbtPlugin("org.http4s" %% "sbt-http4s-org" % "0.13.4") +addSbtPlugin("org.http4s" %% "sbt-http4s-org" % "0.14.2") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") From d5bc6c14cdabf808ec87754e662bb5a77ba513c3 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 15:44:59 +0400 Subject: [PATCH 4/8] Set Scalafix config for Test in build.sbt --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index e47d5dc1b..3317f219b 100644 --- a/build.sbt +++ b/build.sbt @@ -14,6 +14,7 @@ ThisBuild / crossScalaVersions := Seq(Scala3, Scala212, Scala213) ThisBuild / scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last ThisBuild / tlBaseVersion := "0.23" ThisBuild / tlFatalWarningsInCi := !tlIsScala3.value // See SSLStage +ThisBuild / Test / scalafixConfig := Some(file(".scalafix.test.conf")) // 11 and 17 blocked by https://github.com/http4s/blaze/issues/376 ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")) From 2ab289e35de66a0c3bc1ee7c110936757d78d42d Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 15:45:57 +0400 Subject: [PATCH 5/8] Regenerate ci.yml --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec6bb120..11aa49e02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,9 @@ name: Continuous Integration on: pull_request: - branches: ['**'] + branches: ['**', '!update/**'] push: - branches: ['**'] + branches: ['**', '!update/**'] tags: [v*] env: @@ -87,6 +87,10 @@ jobs: - name: Check Java formatting run: sbt '++${{ matrix.scala }}' '${{ matrix.ci }}' javafmtCheckAll + - name: Check scalafix lints + if: matrix.java == 'temurin@8' && !startsWith(matrix.scala, '3.') + run: sbt '++${{ matrix.scala }}' 'scalafixAll --check' + - name: Check unused compile dependencies if: matrix.java == 'temurin@8' run: sbt '++${{ matrix.scala }}' unusedCompileDependenciesTest From 64f09afdc72bc03c2b7152ca45d879a497cb57d2 Mon Sep 17 00:00:00 2001 From: danicheg Date: Wed, 8 Jun 2022 20:26:29 +0400 Subject: [PATCH 6/8] Disable Scalafix for old modules --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 3317f219b..569c04e62 100644 --- a/build.sbt +++ b/build.sbt @@ -55,7 +55,8 @@ lazy val commonSettings = Seq( } }, run / fork := true, - scalafmtConfig := file(".scalafmt.blaze.conf") + scalafmtConfig := file(".scalafmt.blaze.conf"), + scalafixAll := {} // let's disable Scalafix for old modules *for a while* ) // currently only publishing tags From 04688e4c19767eb3c95ebd51a731d212bbf97e9d Mon Sep 17 00:00:00 2001 From: danicheg Date: Thu, 9 Jun 2022 19:27:16 +0400 Subject: [PATCH 7/8] Introduce dummy config for old blaze modules --- .scalafix.blaze.conf | 7 +++++++ build.sbt | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .scalafix.blaze.conf diff --git a/.scalafix.blaze.conf b/.scalafix.blaze.conf new file mode 100644 index 000000000..26ad6fae6 --- /dev/null +++ b/.scalafix.blaze.conf @@ -0,0 +1,7 @@ +rules = [ + RedundantSyntax +] + +triggered.rules = [ + RedundantSyntax +] \ No newline at end of file diff --git a/build.sbt b/build.sbt index 569c04e62..bd4704b94 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,6 @@ ThisBuild / crossScalaVersions := Seq(Scala3, Scala212, Scala213) ThisBuild / scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last ThisBuild / tlBaseVersion := "0.23" ThisBuild / tlFatalWarningsInCi := !tlIsScala3.value // See SSLStage -ThisBuild / Test / scalafixConfig := Some(file(".scalafix.test.conf")) // 11 and 17 blocked by https://github.com/http4s/blaze/issues/376 ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")) @@ -56,7 +55,7 @@ lazy val commonSettings = Seq( }, run / fork := true, scalafmtConfig := file(".scalafmt.blaze.conf"), - scalafixAll := {} // let's disable Scalafix for old modules *for a while* + scalafixConfig := Some(file(".scalafix.blaze.conf")) ) // currently only publishing tags @@ -170,7 +169,8 @@ lazy val blazeCore = project .exclude[DirectMissingMethodProblem]("org.http4s.blazecore.util.IdentityWriter.ec") ) else Seq.empty - } + }, + Test / scalafixConfig := Some(file(".scalafix.test.conf")) ) .dependsOn(http) @@ -233,7 +233,8 @@ lazy val blazeServer = project ) ) else Seq.empty, - } + }, + Test / scalafixConfig := Some(file(".scalafix.test.conf")) ) .dependsOn(blazeCore % "compile;test->test") @@ -330,7 +331,8 @@ lazy val blazeClient = project ) ) else Seq.empty - } + }, + Test / scalafixConfig := Some(file(".scalafix.test.conf")) ) .dependsOn(blazeCore % "compile;test->test") @@ -343,7 +345,8 @@ lazy val examples = Project("blaze-examples", file("examples")) "org.http4s" %% "http4s-dsl" % http4sVersion, "org.http4s" %% "http4s-circe" % http4sVersion, "io.circe" %% "circe-generic" % "0.14.2" - ) + ), + Test / scalafixConfig := Some(file(".scalafix.test.conf")) ) .dependsOn(blazeServer, blazeClient) From 7ccd481bb636a968fd17c27bd0ca7ac25213fa31 Mon Sep 17 00:00:00 2001 From: danicheg Date: Thu, 9 Jun 2022 21:25:59 +0400 Subject: [PATCH 8/8] A manual fix of BlazeClientBase to satisfy scalafix at CI --- .../test/scala/org/http4s/blaze/client/BlazeClientBase.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala b/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala index 9cf9d3283..0c2ee55e0 100644 --- a/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala +++ b/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala @@ -20,8 +20,8 @@ package client import cats.effect._ import cats.effect.kernel.Resource import cats.effect.std.Dispatcher -import cats.syntax.all._ import cats.implicits.catsSyntaxApplicativeId +import cats.syntax.all._ import fs2.Stream import io.netty.channel.ChannelHandlerContext import io.netty.handler.codec.http.HttpMethod