Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created July 2, 2025 06:40
Show Gist options
  • Save xuwei-k/e217e0cef6a4541321ffa3cbafb8680e to your computer and use it in GitHub Desktop.
Save xuwei-k/e217e0cef6a4541321ffa3cbafb8680e to your computer and use it in GitHub Desktop.
import sbt._
import sbt.Keys._
import scalafix.sbt.ScalafixPlugin
import scalafix.sbt.ScalafixPlugin.autoImport.ScalafixConfig
/**
* [[https://xuwei-k.hatenablog.com/entry/2025/03/11/214521]]
*/
object MyScalafixPlugin extends AutoPlugin {
override def trigger: PluginTrigger =
allRequirements
override def requires: Plugins =
ScalafixPlugin
override def projectSettings: Seq[Def.Setting[?]] = Def.settings(
ScalafixConfig / products ++= (
(LocalProject("scalafixRules") / Compile / externalDependencyClasspath).value.map(_.data)
),
ScalafixConfig / products += {
(LocalProject("scalafixRules") / Compile / packageBin).value
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment