kitlangton / kitlangton/scala-update
[feature request] - Add support for mill plugin updates
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 151
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
I've been using mill more and this seems to work pretty great for ivyDeps that are defined, but not mill plugins that are defined at the top of your build file. It'd be great if this could be supported since these aren't caught by Scala steward.
Some helpful info
A mill plugin typically looks like this:
import $ivy.`com.goyeau::mill-scalafix::0.2.8`
You could capture this very similiar to how we do the other plugins, but instead of a Term.Interpolate you'd want something like this:
private val importString = raw"([^:]*)::([^:]*)::(\S*)".r
case Importer(
Term.Name("$ivy"),
Importee.Name(Name.Indeterminate(importString(group, artifact, version))) :: _
) =>
Some((Group(group), Artifact(artifact), Lit.String(version)))
Other things to consider
While the syntax looks familiar, there are some oddities here. Typically mill plugins are published with a _mill<mill version prefix><scala-version> attatched to the artifact. So in reality, for 2.13 the artifact you'd want to search for up above is:
mill-scalafix_mill0.10_2.13:0.2.9
Internally mill does this translation, so scala-update would also have to do it. Ideally once you recognize this plugin you'd search for a .mill-version file in the root of the workspace to know whether you should put _mill0.10 for example.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing plugin handling around Term.Interpolate and the Importer pattern. Add support for $ivy imports such as com.goyeau::mill-scalafix::0.2.8, using the workspace-root .mill-version to derive the mill and Scala artifact suffixes. Done means mill plugin updates are discovered and resolved like the existing dependency updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100