diff --git a/core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala b/core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala index 72f5421b..10a6426e 100644 --- a/core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala +++ b/core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala @@ -76,24 +76,30 @@ object TypelevelPlugin extends AutoPlugin { java <- githubWorkflowJavaVersions.value.tail // default java is head } yield MatrixExclude(Map("scala" -> scala, "java" -> java.render)) }, - GlobalScope / tlCommandAliases ++= { + GlobalScope / tlPrePRSteps ++= { val header = tlCiHeaderCheck.value val scalafmt = tlCiScalafmtCheck.value val javafmt = tlCiJavafmtCheck.value val scalafix = tlCiScalafixCheck.value - val prePR = List("project /", "githubWorkflowGenerate") ++ + List("project /", "githubWorkflowGenerate") ++ List("+headerCreateAll").filter(_ => header) ++ List("+scalafixAll").filter(_ => scalafix) ++ List("+scalafmtAll", "scalafmtSbt").filter(_ => scalafmt) ++ - List("javafmtAll").filter(_ => javafmt) + List("javafmtAll").filter(_ => javafmt) ++ + List("compile", "test") + }, + GlobalScope / tlCommandAliases ++= { + val header = tlCiHeaderCheck.value + val scalafmt = tlCiScalafmtCheck.value + val javafmt = tlCiJavafmtCheck.value val botHook = List("githubWorkflowGenerate") ++ List("+headerCreateAll").filter(_ => header) ++ + List("javafmtAll").filter(_ => javafmt) ++ List("+scalafmtAll", "scalafmtSbt").filter(_ => scalafmt) Map( - "prePR" -> prePR, "tlPrePrBotHook" -> botHook ) } diff --git a/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala b/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala index 5f55abe2..02a4235e 100644 --- a/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala +++ b/kernel/src/main/scala/org/typelevel/sbt/TypelevelKernelPlugin.scala @@ -45,6 +45,9 @@ object TypelevelKernelPlugin extends AutoPlugin { "Command aliases defined for this build" ) + lazy val tlPrePRSteps = + settingKey[List[String]]("Steps to be performed before a user submits a PR") + @deprecated( "Use `tlCommandAliases` for a more composable command definition experience", "0.6.1") @@ -62,7 +65,8 @@ object TypelevelKernelPlugin extends AutoPlugin { override def globalSettings = Seq( Def.derive(tlIsScala3 := scalaVersion.value.startsWith("3.")), tlCommandAliases := Map( - "tlReleaseLocal" -> List("reload", "project /", "+publishLocal") + "tlReleaseLocal" -> List("reload", "project /", "+publishLocal"), + "prePR" -> ("reload" :: "project /" :: tlPrePRSteps.value) ), onLoad := { val aliases = tlCommandAliases.value @@ -78,7 +82,8 @@ object TypelevelKernelPlugin extends AutoPlugin { onUnload.value.compose { (state: State) => aliases.foldLeft(state) { (state, alias) => BasicCommands.removeAlias(state, alias) } } - } + }, + tlPrePRSteps := List.empty ) @nowarn("cat=deprecation")