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

dogfooding: run scalafixAll with local scalafix-interfaces #1784

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Jun 11, 2023

This adds a command to replace the scalafix-interfaces brought in by sbt-scalafix with the local one. Rationale: observe impact of changes & detect regressions.

The implementation is not great as it's slow and mutates state, but I ran into dead-ends for the 2 alternatives I explored:

  • injecting a custom scalafix-interfaces.properties to force the default scalafix-interfaces to load a custom scalafix-cli would require changes in the classloading logic to favor the custom property file over the one embedded in the JAR
  • sbt-scalafix's scalafixInterfacesProvider could be rewired to cli2_12/fullClasspath with some minor addition, but it would require turning scalafixInterfacesProvider into a task key, which is not possible because the parser's completion can only depend on setting keys

@bjaglin bjaglin force-pushed the dogfooding-command branch 4 times, most recently from e1c41e9 to a905277 Compare June 11, 2023 19:32
s"all cli$suffix/publishLocalTransitive interfaces/publishLocal" ::
"reload plugins" ::
s"""set dependencyOverrides += "ch.epfl.scala" % "scalafix-interfaces" % "$v"""" :: // as documented in installation.md
"session save" ::
Copy link
Collaborator Author

@bjaglin bjaglin Jun 11, 2023

Choose a reason for hiding this comment

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

this pollutes a bit the history locally, but it shouldn't hurt (and I can't think of a way to trigger the main project's command without the reload below anyway)

sbt:project> show dependencyOverrides
[info] * org.scala-sbt:scripted-plugin:1.8.3
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+10-1a516a0c+20230611-2036-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+10-1a516a0c+20230611-2037-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+10-1a516a0c+20230611-2038-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+11-61c0c9e4+20230611-2100-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+15-54c3f8dd+20230611-2111-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+15-ee65ae33+20230611-2113-SNAPSHOT
[info] * ch.epfl.scala:scalafix-interfaces:0.11.0+15-e1c41e9f+20230611-2116-SNAPSHOT

@bjaglin bjaglin changed the title run scalafixAll with local scalafix-interfaces dogfooding: run scalafixAll with local scalafix-interfaces Jun 11, 2023
@bjaglin bjaglin force-pushed the dogfooding-command branch from a905277 to 67f5009 Compare June 11, 2023 19:43
@bjaglin bjaglin force-pushed the dogfooding-command branch from 67f5009 to bf93f1d Compare June 11, 2023 19:54
@bjaglin bjaglin marked this pull request as ready for review June 12, 2023 10:12
@bjaglin bjaglin merged commit f9df65f into scalacenter:main Jun 12, 2023
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.

1 participant