diff --git a/build.sc b/build.sc index ca23819..58cdc29 100644 --- a/build.sc +++ b/build.sc @@ -12,7 +12,7 @@ import mill.scalalib.api.ZincWorkerUtil.scalaNativeBinaryVersion import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl} import scalalib._ -val millVersions = Seq("0.10.12", "0.11.1") +val millVersions = Seq("0.10.15", "0.11.0") def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(millVersion) object `mill-scalafix` extends Cross[MillScalafixCross](millVersions) diff --git a/itest/src/check/build.sc b/itest/src/check/build.sc index fb7a80c..4514168 100644 --- a/itest/src/check/build.sc +++ b/itest/src/check/build.sc @@ -3,6 +3,6 @@ import com.goyeau.mill.scalafix.ScalafixModule import mill.scalalib._ object project extends ScalaModule with ScalafixModule { - def scalaVersion = "2.13.6" + def scalaVersion = "2.13.10" def scalacOptions = Seq("-Ywarn-unused") } diff --git a/itest/src/custom-rule/build.sc b/itest/src/custom-rule/build.sc index b88fa94..ae611c1 100644 --- a/itest/src/custom-rule/build.sc +++ b/itest/src/custom-rule/build.sc @@ -6,7 +6,7 @@ import os._ object project extends ScalaModule with ScalafixModule { def scalaVersion = "2.13.10" - def scalacOptions = Seq("-Ywarn-unused", "-Yrangepos", "-P:semanticdb:synthetics:on") + def semanticDbEnablePluginScalacOptions = super.semanticDbEnablePluginScalacOptions() ++ Seq("-P:semanticdb:synthetics:on") def scalafixIvyDeps = Agg(ivy"org.scala-lang.modules::scala-collection-migrations:2.11.0") } diff --git a/itest/src/fix/.scalafix.conf b/itest/src/fix/.scalafix.conf index df0438a..e16e53c 100644 --- a/itest/src/fix/.scalafix.conf +++ b/itest/src/fix/.scalafix.conf @@ -3,7 +3,8 @@ rules = [ DisableSyntax LeakingImplicitClassVal NoValInForComprehension - ProcedureSyntax + ProcedureSyntax, + ExplicitResultTypes ] DisableSyntax.noVars = true diff --git a/itest/src/fix/build.sc b/itest/src/fix/build.sc index 1e52626..c0a4e7d 100644 --- a/itest/src/fix/build.sc +++ b/itest/src/fix/build.sc @@ -6,6 +6,7 @@ import os._ object project extends ScalaModule with ScalafixModule { def scalaVersion = "2.13.10" + def scalafixScalaBinaryVersion = mill.scalalib.api.ZincWorkerUtil.scalaBinaryVersion(scalaVersion()) def scalacOptions = Seq("-Ywarn-unused") } @@ -14,6 +15,7 @@ def verify() = val fixedScala = read(pwd / "project" / "src" / "Fix.scala") val expected = """object Fix { | def procedure(): Unit = {} + | def myComplexMethod: Map[Int,String] = 1.to(10).map(i => i -> i.toString).toMap |} |""".stripMargin assert(fixedScala == expected) diff --git a/itest/src/fix/project/src/Fix.scala b/itest/src/fix/project/src/Fix.scala index 8b065eb..a210e0e 100644 --- a/itest/src/fix/project/src/Fix.scala +++ b/itest/src/fix/project/src/Fix.scala @@ -1,3 +1,4 @@ object Fix { def procedure() {} + def myComplexMethod = 1.to(10).map(i => i -> i.toString).toMap } diff --git a/mill-scalafix/src/com/goyeau/mill/scalafix/ScalafixModule.scala b/mill-scalafix/src/com/goyeau/mill/scalafix/ScalafixModule.scala index 40e1476..289fe92 100644 --- a/mill-scalafix/src/com/goyeau/mill/scalafix/ScalafixModule.scala +++ b/mill-scalafix/src/com/goyeau/mill/scalafix/ScalafixModule.scala @@ -25,7 +25,7 @@ trait ScalafixModule extends ScalaModule { T.ctx().log, repositoriesTask(), filesToFix(sources()).map(_.path), - Seq(semanticDbData().path), + classpath = (compileClasspath() ++ localClasspath() ++ Seq(semanticDbData())).iterator.toSeq.map(_.path), scalaVersion(), scalafixScalaBinaryVersion(), scalacOptions(),