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

Fix Patch.replaceSymbols bug that affects ScalaTest rule. #1293

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

olafurpg
Copy link
Contributor

Previously, the ScalaTest autofix rule didn't properly handle cases with
renamed imports due to a bug in Scalafix. This commit fixes that bug so
that the ScalaTest rule works correctly as expected.

Previously, the ScalaTest autofix rule didn't properly handle cases with
renamed imports due to a bug in Scalafix. This commit fixes that bug so
that the ScalaTest rule works correctly as expected.
@mosesn
Copy link

mosesn commented Dec 3, 2020

@mlachkar I'm not familiar with the scalafix OSS process, what else would this patch need to be merged in? We'd love to take advantage of the improvement :) (we think we can start cross-building for Scala 3 after this lands, if this lets us migrate to ScalaTest 3.2.x!)

@mlachkar
Copy link
Collaborator

mlachkar commented Dec 4, 2020

Of course, I can merge it.

@mlachkar mlachkar merged commit ae8741e into scalacenter:master Dec 4, 2020
@mosesn
Copy link

mosesn commented Dec 5, 2020

@mlachkar great, thank you! What is the typical release cadence for scalafix? I'm going to try to figure out how we can build a snapshot locally (unless you publish nightlies?) but it would be cool to have this released too :)

@bjaglin
Copy link
Collaborator

bjaglin commented Dec 7, 2020

@mosesn until scalafix 0.9.25 is out, you can use 0.9.24+4-ae8741e5-SNAPSHOT available on Sonatype OSS snapshots.

If you use sbt-scalafix, this should do it:

build.sbt

+ThisBuild / scalafixResolvers += coursierapi.MavenRepository.of("https://oss.sonatype.org/content/repositories/snapshots")

project/plugins.sbt

 addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.24")
+resolvers += Resolver.sonatypeRepo("snapshots")
+libraryDependencies += "ch.epfl.scala" % "scalafix-interfaces" % "0.9.24+4-ae8741e5-SNAPSHOT"

@mosesn
Copy link

mosesn commented Dec 14, 2020

An update from my side! I finally got some time to look at this, and I was able to use that snapshot version. I'm trying it out as we speak, thanks!! Unfortunately, running a scalafix task across our entire codebase takes all day.

@mosesn
Copy link

mosesn commented Dec 18, 2020

I tried it out, and I still have a problem. I'm not very familiar with scalafix, can someone who is more familiar with it help me figure out how to solve my problem? I'll file a ticket to explain.

The short version is that if it's possible to do a rename that causes a name collision, which can make code uncompileable.

Ticket here: #1305

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.

4 participants