Skip to content

Commit

Permalink
chore: Update scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rlemaitre committed Feb 20, 2024
1 parent 226e361 commit dd3fdf6
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 100 deletions.
18 changes: 15 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ align.preset = most

docstrings.style = keep

project.excludeFilters = [".*\\.sbt", "/project/.*"]

rewrite.rules = [Imports]
rewrite.rules = [Imports, RedundantBraces, RedundantParens, PreferCurlyFors]
rewrite.imports.sort = scalastyle
rewrite.imports.expand = true
rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.generalExpressions = true
rewrite.redundantBraces.ifElseExpressions = true
newlines.afterCurlyLambdaParams=squash
rewrite.scala3.convertToNewSyntax = true
rewrite.scala3.removeOptionalBraces = yes
rewrite.scala3.insertEndMarkerMinLines = 5

fileOverride {
"glob:**.sbt" {
runner.dialect = scala212source3
}

"glob:**/project/**.*" {
runner.dialect = scala212source3
}
}
95 changes: 48 additions & 47 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
import org.typelevel.scalacoptions.{ScalaVersion, ScalacOptions}
import org.typelevel.scalacoptions.ScalacOptions
import org.typelevel.scalacoptions.ScalaVersion

ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / versionScheme := Some("semver-spec")
inThisBuild(
List(
scalaVersion := "3.3.1",
organization := "com.rlemaitre",
homepage := Some(url("https://pillars.rlemaitre.com/")),
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
scmInfo := Some(
ScmInfo(
url("https://github.com/rlemaitre/pillars/"),
"scm:git:[email protected]:rlemaitre/pillars.git"
)
),
developers := List(
Developer(
"rlemaitre",
"Raphaël Lemaitre",
"[email protected]",
url("https://github.com/rlemaitre")
)
),
startYear := Some(2023),
licenses += ("Apache-2.0", url(
"http://www.apache.org/licenses/LICENSE-2.0"
)),
scalacOptions ++= ScalacOptions.tokensForVersion(
ScalaVersion.V3_3_0,
Set(
ScalacOptions.deprecation,
ScalacOptions.feature,
ScalacOptions.fatalWarnings,
ScalacOptions.lint
) ++ ScalacOptions.privateWarnOptions ++ ScalacOptions.privateWarnUnusedOptions
) ++ Seq("-new-syntax")
)
)
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true"

Compile / scalacOptions ++= ScalacOptions.tokensForVersion(
ScalaVersion.V3_3_0,
Set(
ScalacOptions.sourceFuture,
List(
scalaVersion := "3.3.1",
organization := "com.rlemaitre",
homepage := Some(url("https://pillars.rlemaitre.com/")),
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
scmInfo := Some(
ScmInfo(
url("https://github.com/rlemaitre/pillars/"),
"scm:git:[email protected]:rlemaitre/pillars.git"
)
),
developers := List(
Developer(
"rlemaitre",
"Raphaël Lemaitre",
"[email protected]",
url("https://github.com/rlemaitre")
)
),
startYear := Some(2023),
licenses += ("Apache-2.0", url(
"http://www.apache.org/licenses/LICENSE-2.0"
)),
scalacOptions ++= ScalacOptions.tokensForVersion(
ScalaVersion.V3_3_0,
Set(
ScalacOptions.deprecation,
ScalacOptions.feature,
ScalacOptions.fatalWarnings,
ScalacOptions.lint
) ++ ScalacOptions.privateWarnOptions ++ ScalacOptions.privateWarnUnusedOptions
) ++ ScalacOptions.privateWarnOptions ++ ScalacOptions.privateWarnUnusedOptions
) ++ Seq("-new-syntax")
)
)
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true"

Compile / scalacOptions ++= ScalacOptions.tokensForVersion(
ScalaVersion.V3_3_0,
Set(
ScalacOptions.sourceFuture,
ScalacOptions.deprecation,
ScalacOptions.feature,
ScalacOptions.fatalWarnings,
ScalacOptions.lint
) ++ ScalacOptions.privateWarnOptions ++ ScalacOptions.privateWarnUnusedOptions
) ++ Seq("-new-syntax", "-Xmax-inlines=128")

enablePlugins(ScalaUnidocPlugin)
Expand Down
100 changes: 50 additions & 50 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
import sbt.*
object Dependencies {
val effect: Seq[ModuleID] = Seq(
"org.typelevel" %% "cats-core" % "2.10.0",
"org.typelevel" %% "cats-effect" % "3.5.3",
"co.fs2" %% "fs2-core" % "3.9.4",
"org.typelevel" %% "cats-collections-core" % "0.9.8",
"org.typelevel" %% "cats-time" % "0.5.1",
"org.typelevel" %% "mouse" % "1.2.2"
"org.typelevel" %% "cats-core" % "2.10.0",
"org.typelevel" %% "cats-effect" % "3.5.3",
"co.fs2" %% "fs2-core" % "3.9.4",
"org.typelevel" %% "cats-collections-core" % "0.9.8",
"org.typelevel" %% "cats-time" % "0.5.1",
"org.typelevel" %% "mouse" % "1.2.2"
)

val model: Seq[ModuleID] = Seq(
"com.comcast" %% "ip4s-core" % "3.5.0",
"io.github.iltotore" %% "iron" % "2.4.0",
"io.github.iltotore" %% "iron-cats" % "2.4.0",
"io.github.iltotore" %% "iron-circe" % "2.4.0",
"io.github.iltotore" %% "iron-decline" % "2.4.0"
"com.comcast" %% "ip4s-core" % "3.5.0",
"io.github.iltotore" %% "iron" % "2.4.0",
"io.github.iltotore" %% "iron-cats" % "2.4.0",
"io.github.iltotore" %% "iron-circe" % "2.4.0",
"io.github.iltotore" %% "iron-decline" % "2.4.0"
)

val commandLine: Seq[ModuleID] = Seq(
"com.monovore" %% "decline" % "2.4.1",
"com.monovore" %% "decline-effect" % "2.4.1"
"com.monovore" %% "decline" % "2.4.1",
"com.monovore" %% "decline-effect" % "2.4.1"
)

val json: Seq[ModuleID] = Seq(
"io.circe" %% "circe-core" % "0.14.6",
"io.circe" %% "circe-generic" % "0.14.6",
"io.circe" %% "circe-parser" % "0.14.6",
"io.circe" %% "circe-yaml" % "0.15.1"
"io.circe" %% "circe-core" % "0.14.6",
"io.circe" %% "circe-generic" % "0.14.6",
"io.circe" %% "circe-parser" % "0.14.6",
"io.circe" %% "circe-yaml" % "0.15.1"
)

val http4s: Seq[ModuleID] = Seq(
"org.http4s" %% "http4s-core" % "0.23.25",
"org.http4s" %% "http4s-dsl" % "0.23.25",
"org.http4s" %% "http4s-circe" % "0.23.25"
"org.http4s" %% "http4s-core" % "0.23.25",
"org.http4s" %% "http4s-dsl" % "0.23.25",
"org.http4s" %% "http4s-circe" % "0.23.25"
)

val http4sClient: Seq[ModuleID] = Seq(
"org.http4s" %% "http4s-netty-client" % "0.5.13",
"org.http4s" %% "http4s-netty-client" % "0.5.13"
)
val http4sServer: Seq[ModuleID] = Seq(
"org.http4s" %% "http4s-netty-server" % "0.5.13",
"org.http4s" %% "http4s-netty-server" % "0.5.13"
)
val scodec: Seq[ModuleID] = Seq(
"org.scodec" %% "scodec-bits" % "2.2.2",
"org.scodec" %% "scodec-core" % "2.2.2"
val scodec: Seq[ModuleID] = Seq(
"org.scodec" %% "scodec-bits" % "2.2.2",
"org.scodec" %% "scodec-core" % "2.2.2"
)

private val tapir = Seq(
"com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-opentelemetry-metrics" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-iron" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-http4s-client" % "1.9.9" % Test,
"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % "1.9.9" % Test,
"com.softwaremill.sttp.client3" %% "core" % "3.9.3" % Test
// "com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-bundle" % "1.9.1",
"com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-opentelemetry-metrics" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-iron" % "1.9.9",
"com.softwaremill.sttp.tapir" %% "tapir-http4s-client" % "1.9.9" % Test,
"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % "1.9.9" % Test,
"com.softwaremill.sttp.client3" %% "core" % "3.9.3" % Test
// "com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-bundle" % "1.9.1",
)

val logging: Seq[ModuleID] = Seq( //
"com.outr" %% "scribe" % "3.13.0",
"com.outr" %% "scribe-cats" % "3.13.0",
"com.outr" %% "scribe-slf4j" % "3.13.0",
"com.outr" %% "scribe-json-circe" % "3.13.0",
"com.outr" %% "scribe-file" % "3.13.0"
"com.outr" %% "scribe" % "3.13.0",
"com.outr" %% "scribe-cats" % "3.13.0",
"com.outr" %% "scribe-slf4j" % "3.13.0",
"com.outr" %% "scribe-json-circe" % "3.13.0",
"com.outr" %% "scribe-file" % "3.13.0"
)

val tests: Seq[ModuleID] = Seq(
"org.scalameta" %% "munit" % "0.7.29" % Test,
"org.typelevel" %% "munit-cats-effect-3" % "1.0.7" % Test,
"org.scalameta" %% "munit-scalacheck" % "0.7.29" % Test,
"io.github.iltotore" %% "iron-scalacheck" % "2.4.0" % Test
"org.scalameta" %% "munit" % "0.7.29" % Test,
"org.typelevel" %% "munit-cats-effect-3" % "1.0.7" % Test,
"org.scalameta" %% "munit-scalacheck" % "0.7.29" % Test,
"io.github.iltotore" %% "iron-scalacheck" % "2.4.0" % Test
)

val observability: Seq[ModuleID] = Seq(
"org.typelevel" %% "otel4s-java" % "0.4.0",
"io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.35.0" % Runtime,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % "1.35.0" % Runtime
"org.typelevel" %% "otel4s-java" % "0.4.0",
"io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.35.0" % Runtime,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % "1.35.0" % Runtime
)

val database: Seq[ModuleID] = Seq(
"org.tpolecat" %% "skunk-core" % "1.1.0-M3",
"org.tpolecat" %% "skunk-circe" % "1.1.0-M3"
// "dev.rolang" %% "dumbo" % "0.0.6" //enable when dumbo uses skunk 1.1.0-M2
"org.tpolecat" %% "skunk-core" % "1.1.0-M3",
"org.tpolecat" %% "skunk-circe" % "1.1.0-M3"
// "dev.rolang" %% "dumbo" % "0.0.6" //enable when dumbo uses skunk 1.1.0-M2
) ++ tests

val flags: Seq[ModuleID] = Seq(
val flags: Seq[ModuleID] = Seq(
"org.typelevel" %% "literally" % "1.1.0"
) ++ tests
val httpClient: Seq[ModuleID] = http4sClient ++ http4s ++ tests
val core: Seq[ModuleID] =
val core: Seq[ModuleID] =
effect ++ json ++ tapir ++ http4sServer ++ model ++ commandLine ++ logging ++ observability ++ tests
}

0 comments on commit dd3fdf6

Please sign in to comment.