scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Using custom dependency rules for scalafix-migrations with 'type: "build"'

Open cptwunderlich opened this issue 1 year ago • 0 comments

I tried using a scalafix-migration with type: "build", which uses a custom rule, published to a private repository. But I realized, that these types of migrations are run with scalafix CLI, which does not resolve rules from other repositories. One would have to explicitly call it with scalafix --tool-classpath $(cs fetch myorg::rules:vesion -p) --rules=MyRule.

Is there any reasonable way to add this functionality to scala-steward?

My use-case is this: We have an internal meta-package and we are preparing an upcoming release with many changes, e.g., upgrade to Play 2.9. However, Tapir jumped straight to Play 3 for its submodules (e.g., tapir-play-server) and I created a new submodule for Play 2.9 instead (tapir-play29-server). So I need to rewrite the Dependencies.scala file.

I also looked at the artifact migrations, but it seems like this only works if the listed artifact itself has a new version. Post-update hooks seem a bit hacky for this scenario and there is no way to apply this to a specific version only.

cptwunderlich avatar Jan 29 '24 18:01 cptwunderlich