Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Scalafix and bump sbt-http4s-org version #694

Merged
merged 8 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danicheg the test config also enforces organize imports, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Then my hypothesis about Test config is wrong. But why all is good at local 🤯

]

triggered.rules = [
Http4sGeneralLinters
Http4sUseLiteralsSyntax
LeakingImplicitClassVal
]
Original file line number Diff line number Diff line change
@@ -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
15 changes: 10 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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
@@ -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)

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

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

@@ -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)

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")