Skip to content

Instantly share code, notes, and snippets.

@tori3852
Created August 7, 2016 20:03
Show Gist options
  • Save tori3852/68ca9637d79fccb6b5e0251a868903d2 to your computer and use it in GitHub Desktop.
Save tori3852/68ca9637d79fccb6b5e0251a868903d2 to your computer and use it in GitHub Desktop.
Scala style checkeck (sbt project)
(scalastyleConfigUrl in Compile) := Some(url("https://gist.githubusercontent.com/tori3852/b6d29f650b9d207ebe6f2211a0a53648/raw/scalastyle_config.xml"))
(scalastyleConfigUrl in Test) := Some(url("https://gist.githubusercontent.com/tori3852/b6d29f650b9d207ebe6f2211a0a53648/raw/scalastyle_config.xml"))
// checkstyle on compile
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
(compile in Compile) <<= (compile in Compile) dependsOn compileScalastyle
// checkstyle (test) on compile
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value
(test in Test) <<= (test in Test) dependsOn testScalastyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment