Skip to content

Commit

Permalink
Disable -Ycheck-init for cats due to -Xfatal-warnings
Browse files Browse the repository at this point in the history
cats enables -Xfatal-warnings and we don't want to change the library
to create conflicts with upstream.
  • Loading branch information
liufengyun committed Feb 12, 2021
1 parent ede74b3 commit 3ee75fb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ final case class SbtCommunityProject(
extraSbtArgs: List[String] = Nil,
dependencies: List[CommunityProject] = Nil,
sbtPublishCommand: String = null,
sbtDocCommand: String = null
sbtDocCommand: String = null,
scalacOptions: List[String] = List("-Ycheck-init")
) extends CommunityProject:
override val binaryName: String = "sbt"

Expand Down Expand Up @@ -159,10 +160,13 @@ final case class SbtCommunityProject(
s""""dev.zio" %% "izumi-reflect" % "${Versions.izumiReflect}"""",
)

private def scalacOptionsString: String =
scalacOptions.map("\"" + _ + "\"").mkString("List(", ",", ")")

private val baseCommand =
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
++ s"""set dependencyOverrides in ThisBuild ++= ${dependencyOverrides.mkString("Seq(", ", ", ")")}; """
++ """set scalacOptions in Global += "-Ycheck-init";"""
++ (if scalacOptions.isEmpty then "" else s"""set scalacOptions in Global ++= $scalacOptionsString;""")
++ s"++$compilerVersion!; "

override val testCommand =
Expand Down Expand Up @@ -532,7 +536,8 @@ object projects:
project = "discipline-specs2",
sbtTestCommand = "test",
sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal",
dependencies = List(discipline)
dependencies = List(discipline),
scalacOptions = Nil // disabble -Ycheck-init
)

lazy val simulacrumScalafixAnnotations = SbtCommunityProject(
Expand All @@ -545,7 +550,8 @@ object projects:
project = "cats",
sbtTestCommand = "set scalaJSStage in Global := FastOptStage;buildJVM;validateAllJS",
sbtPublishCommand = "catsJVM/publishLocal;catsJS/publishLocal",
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations)
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
scalacOptions = Nil // disable -Ycheck-init, due to -Xfatal-warning
)

lazy val catsMtl = SbtCommunityProject(
Expand Down

0 comments on commit 3ee75fb

Please sign in to comment.