mirror of https://github.com/sbt/sbt.git
parent
2376de63d1
commit
08c49358c7
|
|
@ -10,6 +10,8 @@ ThisBuild / version := {
|
||||||
val v = "1.3.0-SNAPSHOT"
|
val v = "1.3.0-SNAPSHOT"
|
||||||
nightlyVersion.getOrElse(v)
|
nightlyVersion.getOrElse(v)
|
||||||
}
|
}
|
||||||
|
ThisBuild / scalafmtOnCompile := !(Global / insideCI).value
|
||||||
|
ThisBuild / Test / scalafmtOnCompile := !(Global / insideCI).value
|
||||||
|
|
||||||
// ThisBuild settings take lower precedence,
|
// ThisBuild settings take lower precedence,
|
||||||
// but can be shared across the multi projects.
|
// but can be shared across the multi projects.
|
||||||
|
|
@ -43,7 +45,6 @@ def buildLevelSettings: Seq[Setting[_]] =
|
||||||
homepage := Some(url("https://github.com/sbt/sbt")),
|
homepage := Some(url("https://github.com/sbt/sbt")),
|
||||||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")),
|
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")),
|
||||||
resolvers += Resolver.mavenLocal,
|
resolvers += Resolver.mavenLocal,
|
||||||
scalafmtOnCompile := true,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import sbt._
|
||||||
|
import Keys._
|
||||||
|
import org.scalafmt.sbt.ScalafmtPlugin
|
||||||
|
import ScalafmtPlugin.autoImport._
|
||||||
|
|
||||||
|
object FixScalafmtPlugin extends AutoPlugin {
|
||||||
|
override def requires = ScalafmtPlugin
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
val ScalaFmtTag = ConcurrentRestrictions.Tag("scalafmt")
|
||||||
|
|
||||||
|
override def globalSettings: Seq[Def.Setting[_]] =
|
||||||
|
Seq(
|
||||||
|
concurrentRestrictions += Tags.limit(ScalaFmtTag, 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
override def projectSettings: Seq[Def.Setting[_]] =
|
||||||
|
Seq(
|
||||||
|
scalafmtCheckAll := (scalafmtCheckAll.tag(ScalaFmtTag)).value,
|
||||||
|
Compile / scalafmtCheck := ((Compile / scalafmtCheck).tag(ScalaFmtTag)).value,
|
||||||
|
Test / scalafmtCheck := ((Test / scalafmtCheck).tag(ScalaFmtTag)).value,
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue