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

scalafix 0.13.0 #6807

Merged
merged 2 commits into from
Oct 10, 2024
Merged

scalafix 0.13.0 #6807

merged 2 commits into from
Oct 10, 2024

Conversation

bjaglin
Copy link
Member

@bjaglin bjaglin commented Sep 27, 2024

- Support RemoveUnused on 3.3.4
- Load Scalafix with raw scalaVersion for ExplicitResultTypes to work against Scala 3
- allow dynamic loading of PC by default for ExplicitResultTypes
@@ -242,6 +242,8 @@ case class ScalafixProvider(
|OrganizeImports.removeUnused = true
|OrganizeImports.targetDialect = Scala3
|
|ExplicitResultTypes.fetchScala3CompilerArtifactsOnVersionMismatch = true
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Users of ExplicitResultTypes will most likely have a custom cone anyway, but I guess it doesn't hurt to put it there

@@ -379,7 +383,7 @@ case class ScalafixProvider(
}

val result = for {
api <- getScalafix(scalaBinaryVersion)
api <- getScalafix(scalaTarget.scalaVersion)
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@bjaglin bjaglin Sep 27, 2024

Choose a reason for hiding this comment

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

Keeping 2.13 by default for community rules via

val scalaBinaryVersion =
if (isScala3) "2.13" else scalaTarget.scalaBinaryVersion
as they can be loaded by cli_3 and we haven't started cross-building rules to Scala 3 (apart from the built-in ones)

@bjaglin
Copy link
Member Author

bjaglin commented Sep 27, 2024

@tgodzik I pushed the output of mtags3/scalafixAll as a separate commit even though it triggers errors. I guess we should fix them manually in this PR, and fix the root cause in ExplicitResultTypes later. I won't have any free time until Friday next week from my side.

@tgodzik
Copy link
Contributor

tgodzik commented Sep 28, 2024

Thanks! I am out until 7th but I should be able to take a look as soon as I am back.

@bjaglin
Copy link
Member Author

bjaglin commented Sep 29, 2024

In the end, I spinned off usage of scalafix 0.13.0 for the build to #6810, so this can be merged independantly.

@bjaglin bjaglin marked this pull request as ready for review September 29, 2024 21:45
@tgodzik
Copy link
Contributor

tgodzik commented Oct 8, 2024

Seems some tests are indeed failing, I will take a look. Did the 2.11 support drop?

@bjaglin
Copy link
Member Author

bjaglin commented Oct 8, 2024

Seems some tests are indeed failing, I will take a look

I must say that I didn't have time to look.

Did the 2.11 support drop?

One year ago, in Scalafix 0.11.0.

But that's a good point, because of #5770, we can't always pass a full scala version since it isn't supported in the last scalafix-interfaces built for 2.11. That needs to be fixed here.

@tgodzik
Copy link
Contributor

tgodzik commented Oct 9, 2024

@bjaglin I added a commit as fix, let me know if it's alright!

@bjaglin
Copy link
Member Author

bjaglin commented Oct 9, 2024

@tgodzik apologies for sending that half-baked PR, I had done it way too late at night and way too quickly on the GitHub web UI ...

LGTM!

@tgodzik tgodzik merged commit ca4c5d9 into scalameta:main Oct 10, 2024
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants