Skip to content

Commit

Permalink
Merge pull request #694 from danicheg/scalafix
Browse files Browse the repository at this point in the history
Set up Scalafix and bump `sbt-http4s-org` version
  • Loading branch information
danicheg authored Jun 9, 2022
2 parents f447eb1 + 7ccd481 commit 573de0f
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Continuous Integration

on:
pull_request:
branches: ['**']
branches: ['**', '!update/**']
push:
branches: ['**']
branches: ['**', '!update/**']
tags: [v*]

env:
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .scalafix.blaze.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules = [
RedundantSyntax
]

triggered.rules = [
RedundantSyntax
]
15 changes: 15 additions & 0 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rules = [
Http4sFs2Linters
Http4sGeneralLinters
Http4sUseLiteralsSyntax
LeakingImplicitClassVal
ExplicitResultTypes
OrganizeImports
]

triggered.rules = [
Http4sFs2Linters
Http4sGeneralLinters
Http4sUseLiteralsSyntax
LeakingImplicitClassVal
]
12 changes: 12 additions & 0 deletions .scalafix.test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rules = [
Http4sGeneralLinters
Http4sUseLiteralsSyntax
LeakingImplicitClassVal
OrganizeImports
]

triggered.rules = [
Http4sGeneralLinters
Http4sUseLiteralsSyntax
LeakingImplicitClassVal
]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ lazy val commonSettings = Seq(
}
},
run / fork := true,
scalafmtConfig := file(".scalafmt.blaze.conf")
scalafmtConfig := file(".scalafmt.blaze.conf"),
scalafixConfig := Some(file(".scalafix.blaze.conf"))
)

// currently only publishing tags
Expand Down Expand Up @@ -168,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)

Expand Down Expand Up @@ -231,7 +233,8 @@ lazy val blazeServer = project
)
)
else Seq.empty,
}
},
Test / scalafixConfig := Some(file(".scalafix.test.conf"))
)
.dependsOn(blazeCore % "compile;test->test")

Expand Down Expand Up @@ -328,7 +331,8 @@ lazy val blazeClient = project
)
)
else Seq.empty
}
},
Test / scalafixConfig := Some(file(".scalafix.test.conf"))
)
.dependsOn(blazeCore % "compile;test->test")

Expand All @@ -341,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)

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 573de0f

Please sign in to comment.