Skip to content

Commit

Permalink
Reduce concurrency of scalafmtCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed May 13, 2019
1 parent 07af463 commit 455379f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions project/FixScalafmtPlugin.scala
Original file line number Diff line number Diff line change
@@ -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,
)
}

0 comments on commit 455379f

Please sign in to comment.