Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to exclude a certain version of Scala from running scalafix #306

Closed
iRevive opened this issue Jun 19, 2022 · 4 comments
Closed

Comments

@iRevive
Copy link
Contributor

iRevive commented Jun 19, 2022

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'
@armanbilge
Copy link
Member

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.

@iRevive
Copy link
Contributor Author

iRevive commented Jun 19, 2022

The idea to use different configs sounds like a great option.

@armanbilge
Copy link
Member

Scalafix may be available for Scala 3 in the near future.

@armanbilge
Copy link
Member

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

@armanbilge armanbilge closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants