Skip to content

Commit e4efda8

Browse files
committed
Disable -Ycheck-init for cats due to -Xfatal-warnings
cats enables -Xfatal-warnings and we don't want to change the library to create conflicts with upstream.
1 parent 0f034aa commit e4efda8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,17 @@ final case class SbtCommunityProject(
9090
extraSbtArgs: List[String] = Nil,
9191
dependencies: List[CommunityProject] = Nil,
9292
sbtPublishCommand: String = null,
93-
sbtDocCommand: String = null
93+
sbtDocCommand: String = null,
94+
scalacOptions: List[String] = List("-Ycheck-init")
9495
) extends CommunityProject:
9596
override val binaryName: String = "sbt"
9697

98+
private def scalacOptionsString: String =
99+
scalacOptions.map("\"" + _ + "\"").mkString("List(", ",", ")")
100+
97101
private val baseCommand =
98102
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
99-
++ """set scalacOptions in Global += "-Ycheck-init";"""
103+
++ (if scalacOptions.isEmpty then "" else s"""set scalacOptions in Global ++= $scalacOptionsString;""")
100104
++ s"++$compilerVersion!; "
101105

102106
override val testCommand =
@@ -467,7 +471,8 @@ object projects:
467471
project = "discipline-specs2",
468472
sbtTestCommand = "test",
469473
sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal",
470-
dependencies = List(discipline)
474+
dependencies = List(discipline),
475+
scalacOptions = Nil // disabble -Ycheck-init
471476
)
472477

473478
lazy val simulacrumScalafixAnnotations = SbtCommunityProject(
@@ -480,7 +485,8 @@ object projects:
480485
project = "cats",
481486
sbtTestCommand = "set scalaJSStage in Global := FastOptStage;buildJVM;validateAllJS",
482487
sbtPublishCommand = "catsJVM/publishLocal;catsJS/publishLocal",
483-
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations)
488+
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
489+
scalacOptions = Nil // disable -Ycheck-init, due to -Xfatal-warning
484490
)
485491

486492
lazy val catsMtl = SbtCommunityProject(

0 commit comments

Comments
 (0)