diff --git a/project/LintingPlugin.scala b/project/LintingPlugin.scala new file mode 100644 index 0000000..9347a28 --- /dev/null +++ b/project/LintingPlugin.scala @@ -0,0 +1,20 @@ +import sbt.Keys._ +import sbt._ +import scalafix.sbt.ScalafixPlugin.autoImport._ + +object LintingPlugin extends AutoPlugin { + override def trigger = allRequirements + + override val globalSettings = + addCommandAlias("fmt", "; scalafmtSbt; scalafmtAll") ++ + addCommandAlias("fix", "scalafixAll") + + override val projectSettings = + inThisBuild( + Seq( + scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0", + semanticdbEnabled := true, + semanticdbVersion := scalafixSemanticdb.revision + ) + ) +}