sbt-typelevel
sbt-typelevel copied to clipboard
Provide an option to exclude a certain version of Scala from running scalafix
When tlCiScalafixCheck := true the following step is generated:
- name: Check scalafix lints
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'scalafixAll --check'
Unfortunately, some scalafix rules do not work with Scala 3.
It would be nice to have an option to exclude a certain version of scala from running scalafix. For example:
tlCiScalafixExcludedScalaVersion := List("3.1.2")
Generated step:
- name: Check scalafix lints
if: matrix.java == 'temurin@8' && matrix.scala != '3.1.2'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'scalafixAll --check'
Thanks, this is a thorny issue. The good news is scalafix might be coming to Scala 3 in the near future.
I'd like to think of alternative solutions for this as well. For example, some projects have Scala 3-only sources (alongside shared and Scala 2-only sources), and it would be a shame if they can not benefit from at least the supported rules, for example organizing imports (without removing unused). One way would be to use different .scalafix-2.conf and .scalafix-3.conf.
The idea to use different configs sounds like a great option.
Scalafix may be available for Scala 3 in the near future.
- https://github.com/scalacenter/scalafix/pull/1629
Scalafix support for Scala 3 already merged, and will hopefully be published soon. So IMO there is no reason to pursue this issue any further.
https://contributors.scala-lang.org/t/scalafix-cross-compiled-for-scala-3-gsoc-2022/6001