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

make it possible to and do build against a scalafix SNAPSHOT #211

Merged
merged 1 commit into from
May 15, 2021

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented May 12, 2021

Follows #210

It's useful to build and run all scripted tests against a scalafix SNAPSHOT to avoid getting (late) surprises during the 2-step (scalafix/sbt-scalafix) release phase.

Most of the users running SNAPSHOT versions of sbt-scalafix should be able to use one that depends on a SNAPSHOT scalafix since they must already have sonatype snapshots in the metabuild and the default scalafixResolvers will re-resolve scalafix through sonatype snapshots via the embedded coursier.

@bjaglin bjaglin changed the title we can depend on a SNAPSHOT as sonatype snapshots is added by default make it possible to and do build against a scalafix SNAPSHOT May 12, 2021
@bjaglin bjaglin marked this pull request as ready for review May 12, 2021 21:15
@bjaglin bjaglin force-pushed the snapshot branch 2 times, most recently from a2cf9e2 to 2150e2f Compare May 12, 2021 21:53
Comment on lines +11 to +13
val suite = new AbstractSemanticRuleSuite with FunSuiteLike {
override val props = TestkitProperties.loadFromResources()
override val isSaveExpect = true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Non-trivial usage of SemanticRuleSuite that https://github.com/scalacenter/scalafix/pull/1395/files won't cover. See also scalacenter/scalafix#1147.

@bjaglin bjaglin force-pushed the snapshot branch 2 times, most recently from 8cdca64 to cdc31bf Compare May 12, 2021 22:12
- clients that have sonatype public in the metabuild and do not
  override scalafixResolvers can resolve a SNAPSHOT scalafix as
  sonatype snapshots is added by default
- fix failing tests by sticking to the plugin default
- fix failing scripted by removing unnecessary scalafixResolvers
  overrides or adding the sonatype snapshots resolver when scalafix
  is resolved directly
- fix breaking changes in scalafix
@@ -27,6 +27,11 @@ object ScalafixTestkitPlugin extends AutoPlugin {
}
import autoImport._

override def buildSettings: Seq[Def.Setting[_]] =
List(
resolvers += Resolver.sonatypeRepo("snapshots")
Copy link
Collaborator Author

@bjaglin bjaglin May 12, 2021

Choose a reason for hiding this comment

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

ScalafixTestkitPlugin clients of a SNAPSHOT sbt-scalafix must resolve from sonatype snapshots both scalafix-testkit for the test project (where that sbt plugin is enabled) AND scalafix-core for the actual rules project, thus the need for impacting the entire build and not just the project settings.

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