Skip to content

Commit

Permalink
Merge pull request #273 from kitbellew/273
Browse files Browse the repository at this point in the history
SBT: treat warnings as errors
  • Loading branch information
tgodzik authored Dec 18, 2024
2 parents b5e0494 + c6a9439 commit 40bb629
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 12 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ lazy val sharedSettings = Def.settings(
else "-Ywarn-unused-import"
},
scalacOptions += "-deprecation",
scalacOptions += "-Xfatal-warnings",
scalacOptions ++= {
if (isScala213.value) "-Wconf:cat=deprecation:is" :: Nil
else if (isScala3.value) "-Wconf:cat=deprecation:silent" :: Nil
else Nil
},
scalacOptions ++= {
if (isScala3.value) Nil else "-Wconf:cat=feature:is" :: Nil
},
mimaBinaryIssueFilters += languageAgnosticCompatibilityPolicy,
crossScalaVersions := ScalaVersions,
scalaVersion := scala213,
Expand Down Expand Up @@ -207,6 +216,9 @@ lazy val docs = project.in(file("metaconfig-docs")).settings(
"org.scalameta" %%% "munit-scalacheck" % V.munit % Test,
),
publish / skip := true,
dependencyOverrides +=
"org.scalameta" %% "metaconfig-typesafe-config" % (ThisBuild / version)
.value,
moduleName := "metaconfig-docs",
mdocVariables := Map(
"VERSION" -> version.value.replaceFirst("\\+.*", ""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ object TPrintLowPri {
val pre = rec(tpe)
lazy val defs = fansi.Str.join(
refinements.collect {
case (name, tpe: TypeRepr) => fansi.Str("type " + name + " = ") ++
rec(tpe)
case (name, TypeBounds(lo, hi)) => fansi.Str("type " + name) ++
printBounds(lo, hi) ++ rec(tpe)
case (name, tpe: TypeRepr) => fansi.Str("type " + name + " = ") ++
rec(tpe)
},
sep = "; ",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class ConfDynamicSuite extends munit.FunSuite {
assert(conf.dynamic.x.c.d.e.asConf.isNotOk)
}
test("did you mean?") {
val Configured.NotOk(err) = conf.dynamic.banna.asConf
assert(err.toString.contains("Did you mean 'banana'"))
conf.dynamic.banna.asConf match {
case Configured.NotOk(err) =>
assert(err.toString.contains("Did you mean 'banana'"))
case Configured.Ok(value) =>
fail("Expected \"Did you mean 'banana'\" error")
}
}
}

0 comments on commit 40bb629

Please sign in to comment.