diff --git a/build.sbt b/build.sbt index 199b4d25..d2d4aebe 100644 --- a/build.sbt +++ b/build.sbt @@ -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, @@ -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("\\+.*", ""), diff --git a/metaconfig-pprint/shared/src/main/scala-3/metaconfig/pprint/TPrintImpl.scala b/metaconfig-pprint/shared/src/main/scala-3/metaconfig/pprint/TPrintImpl.scala index 710b2f02..6934f0e6 100644 --- a/metaconfig-pprint/shared/src/main/scala-3/metaconfig/pprint/TPrintImpl.scala +++ b/metaconfig-pprint/shared/src/main/scala-3/metaconfig/pprint/TPrintImpl.scala @@ -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 = "; ", ) diff --git a/metaconfig-tests/shared/src/test/scala/metaconfig/ConfDynamicSuite.scala b/metaconfig-tests/shared/src/test/scala/metaconfig/ConfDynamicSuite.scala index 75994a0f..790bd269 100644 --- a/metaconfig-tests/shared/src/test/scala/metaconfig/ConfDynamicSuite.scala +++ b/metaconfig-tests/shared/src/test/scala/metaconfig/ConfDynamicSuite.scala @@ -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") + } } }