joan38/mill-scalafix
A Scalafix plugin for Mill build tool
{ "createdAt": "2020-05-04T00:48:02Z", "defaultBranch": "main", "description": "A Scalafix plugin for Mill build tool", "fullName": "joan38/mill-scalafix", "homepage": "", "language": "Scala", "name": "mill-scalafix", "pushedAt": "2025-10-18T20:32:18Z", "stargazersCount": 39, "topics": [ "mill-module", "mill-plugin", "scala" ], "updatedAt": "2025-10-18T20:32:22Z", "url": "https://github.com/joan38/mill-scalafix"}mill-scalafix
Section titled “mill-scalafix”A scalafix plugin for Mill build tool.
Fix sources
Section titled “Fix sources”build.mill:
//| mvnDeps:import com.goyeau.mill.scalafix.ScalafixModuleimport mill.scalalib._
object project extends ScalaModule with ScalafixModule: def scalaVersion = "3.7.3"> mill project.fix[29/29] project.fix/project/project/src/MyClass.scala:12:11: error: [DisableSyntax.var] mutable state should be avoided private var hashLength = 7 ^^^1 targets failedmill-git.fix A Scalafix linter error was reportedUsing External Rules
Section titled “Using External Rules”You’re also able to use external Scalafix rules by adding them like the below example:
def scalafixIvyDeps = Seq(mvn"com.github.xuwei-k::scalafix-rules:0.6.17")Scalafix Arguments
Section titled “Scalafix Arguments”mill-scalafix takes any argument that can be passed to the Scalafix the command line tool. You could for example check that all files have been fixed with scalafix. We usually use that to enforce rules in CI:
> mill project.fix --check[30/30] project.fix--- /project/project/src/Fix.scala+++ <expected fix>@@ -1,3 +1,3 @@ object Fix {- def procedure() {}+ def procedure(): Unit = {} }1 targets failedproject.fix A Scalafix test error was reported. Run `fix` without `--check` or `--diff` to fix the errorRelated projects
Section titled “Related projects”- scalafix
- Inspired by sbt-scalafix
Contributing
Section titled “Contributing”Contributions are more than welcome! See [CONTRIBUTING.md]!(CONTRIBUTING.md) for all the information and getting help.