@@ -110,7 +110,8 @@ final case class SbtCommunityProject(
110110 extraSbtArgs : List [String ] = Nil ,
111111 dependencies : List [CommunityProject ] = Nil ,
112112 sbtPublishCommand : String = null ,
113- sbtDocCommand : String = null
113+ sbtDocCommand : String = null ,
114+ scalacOptions : List [String ] = List (" -Ycheck-init" )
114115 ) extends CommunityProject :
115116 override val binaryName : String = " sbt"
116117
@@ -159,10 +160,13 @@ final case class SbtCommunityProject(
159160 s """ "dev.zio" %% "izumi-reflect" % " ${Versions .izumiReflect}" """ ,
160161 )
161162
163+ private def scalacOptionsString : String =
164+ scalacOptions.map(" \" " + _ + " \" " ).mkString(" List(" , " ," , " )" )
165+
162166 private val baseCommand =
163167 " clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
164168 ++ s """ set dependencyOverrides in ThisBuild ++= ${dependencyOverrides.mkString(" Seq(" , " , " , " )" )}; """
165- ++ """ set scalacOptions in Global += "-Ycheck-init" ;"""
169+ ++ ( if scalacOptions.isEmpty then " " else s """ set scalacOptions in Global ++= $scalacOptionsString ; """ )
166170 ++ s " ++ $compilerVersion!; "
167171
168172 override val testCommand =
@@ -532,7 +536,8 @@ object projects:
532536 project = " discipline-specs2" ,
533537 sbtTestCommand = " test" ,
534538 sbtPublishCommand = " coreJVM/publishLocal;coreJS/publishLocal" ,
535- dependencies = List (discipline)
539+ dependencies = List (discipline),
540+ scalacOptions = Nil // disabble -Ycheck-init
536541 )
537542
538543 lazy val simulacrumScalafixAnnotations = SbtCommunityProject (
@@ -545,7 +550,8 @@ object projects:
545550 project = " cats" ,
546551 sbtTestCommand = " set scalaJSStage in Global := FastOptStage;buildJVM;validateAllJS" ,
547552 sbtPublishCommand = " catsJVM/publishLocal;catsJS/publishLocal" ,
548- dependencies = List (discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations)
553+ dependencies = List (discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
554+ scalacOptions = Nil // disable -Ycheck-init, due to -Xfatal-warning
549555 )
550556
551557 lazy val catsMtl = SbtCommunityProject (
0 commit comments