scalafix
scalafix copied to clipboard
`ExplicitResultTypes` can't easily be used with projects using sbt-projectmatrix
As scalafixScalaBinaryVersion must be set at the ThisBuild level (say 2.13 for an example) and ExplicitResultTypes requires the binary version of each project to match the one used in Scalafix, an aggregating scalafixAll run will fail on 2.11 and 2.12 projects. There is no easy way in sbt-projectmatrix or sbt-scalafix to run scalafixAll only on 2.13 projects.
More generally, usage of sbt-projectmatrix with sbt-scalafix is non-optimal at best, dangerous at worst, as an aggregating scalafixAll runs rewrites across each axis in parallel. The same applies for scalafmt I believe.
Workaround: https://github.com/scalacenter/scalafix/blob/7cfbad5582705b11df455d8606a1007b23604ef1/project/ScalafixBuild.scala#L220-L235
Somewhat related: https://github.com/scalacenter/scalafix/issues/1747
https://github.com/scalacenter/scalafix/issues/1583 would solve this