Skip to content

Conversation

@armanbilge
Copy link
Member

Will fix #524.

Currently fails with:

To use Scalafix on Scala 3 projects, you must unset scalafixBinaryScalaVersion. Rules such as ExplicitResultTypes requiring the project version to match the Scalafix version are unsupported for the moment.

@armanbilge armanbilge marked this pull request as ready for review August 30, 2021 02:48
@armanbilge armanbilge requested a review from japgolly August 30, 2021 02:49
@japgolly
Copy link
Contributor

Oh wooooooooooooow, nice idea!! I didn't think of that.

Copy link
Contributor

@japgolly japgolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple and elegant! Just 2 tiny changes requested.

build.sbt Outdated
if (scalaVersion.value.startsWith("2."))
(root / Compile / scalafix).toTask("")
else
Def.task(())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this to root / Compile / compile so that Scala 3 does a recompile after scalafmt? (I have had a few rare bad experiences and even though quite rare, I want to catch that if they pop up again)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes!

build.sbt Outdated
root / Compile / scalafmt,
root / Compile / compile,
Def.taskDyn {
if (scalaVersion.value.startsWith("2."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we indent this whole block within Def.taskDyn

@armanbilge armanbilge requested a review from japgolly August 30, 2021 02:55
@armanbilge
Copy link
Member Author

Oops, seems I buggered this, fixing...

build.sbt Outdated
if (scalaVersion.value.startsWith("2."))
(root / Compile / scalafix).toTask("")
else
(root / Compile / compile).toTask("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the problem?

Suggested change
(root / Compile / compile).toTask("")
root / Compile / compile
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, tried that already. Tbh I'm a bit stumped, never quite made friends with sbt lol.

@armanbilge armanbilge requested a review from japgolly August 30, 2021 03:25
Copy link
Contributor

@japgolly japgolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@japgolly japgolly merged commit 9f1467b into master Aug 30, 2021
@japgolly japgolly deleted the issue/524 branch August 30, 2021 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants