scalafix icon indicating copy to clipboard operation
scalafix copied to clipboard

`ExplicitResultTypes` can't easily be used with projects using sbt-projectmatrix

Open bjaglin opened this issue 3 years ago • 3 comments

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.

bjaglin avatar Apr 10 '22 09:04 bjaglin

Workaround: https://github.com/scalacenter/scalafix/blob/7cfbad5582705b11df455d8606a1007b23604ef1/project/ScalafixBuild.scala#L220-L235

bjaglin avatar Apr 10 '22 16:04 bjaglin

Somewhat related: https://github.com/scalacenter/scalafix/issues/1747

bjaglin avatar Jun 02 '23 08:06 bjaglin

https://github.com/scalacenter/scalafix/issues/1583 would solve this

bjaglin avatar Feb 05 '24 08:02 bjaglin