-
Notifications
You must be signed in to change notification settings - Fork 185
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
Support SBT IntegrationTest
configuration
#331
Comments
Using Only a few warnings:
But that is probably because the file was modified (import removed) and it is processed more than once... (the warning is shown twice). |
Thank you for reporting! What scalafix version are you using? |
Aaah, great. Yes, scalafix 0.5.0-RC1 was released last night and it depends on RC3. |
For integration tests, scalafix in IntegrationTest := ScalafixPlugin.scalafixTaskImpl(IntegrationTest).evaluated
scalafix := scalafixTaskImpl(Compile, Test, IntegrationTest).evaluated is a good workaround for time being. I haven't figured out how to abstract over this yet because of "illegal dynamic reference" errors. Let's keep this issue open, I definitely want to support this feature. As for the "stale semanticdb" warnings, they could be spurious, see #308. Scalafix has check to make sure it won't override edits to the source file that happen after compilation. In this case, it seems like it's racing with itself. |
OK, would you need to bump the version in the
Nice, thank you!
After the first scalafix run, I did recompile all the class files and on the second scalafix run those warnings did not show up. This may be related to the fact that in my project the integration test .scala files are in a sub-folder of the
Could this be some problem? |
It seems I forgot to bump up the version. Good catch! I will make sure it's upgraded before 0.5.0.
Yes. Scalafix uses |
Would it be better to use |
I agree, |
Fix #331, make is easy to configure custom configurations in sbt-scalafix
This feature is now documented, see https://scalacenter.github.io/scalafix/docs/users/installation.html#integration-tests |
Hi.
In my project, I have enabled the IntegrationTest config:
I am using
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.0-RC1")
.When running
scalafix RemoveUnusedImports
or evenit:scalafix RemoveUnusedImports
there are a lot of warnings about the scala files of the IntegrationTest configuration, a la "No semanticdb associated with" them.Of course, the classpath is not correctly set, as the classes are written to
targetDirectory / scalaBinaryVersion / "it-classes"
.I used
to workaround that problem and it is half-working now - some files are properly processed. Some are not.
Is it possible to set up the scalafix task appropriately for each configuration (
projectConfigurations: Seq[Configuration]
)?\edit: Note, I also get some exceptions during the compilation stage:
The text was updated successfully, but these errors were encountered: