com-lihaoyi / mill

Your shiny new Java/Scala build tool!
https://mill-build.com/
MIT License
1.99k stars 303 forks source link

Make scalafmt version dynamic in ScalafmtModule #3180

Closed pieter-bos closed 1 month ago

pieter-bos commented 1 month ago

I see that the scalafmt version has been stuck at 3.7.15 for a bit, since java 8 support was dropped past that version. I'd like to use some bugfixes from later versions, so how about we make the version dynamic in ScalafmtModule? Scalafmt offers a nice binary-compatible interface through scalafmt-interfaces, so mill itself can stick with that. Some considerations:

Thanks!

lefou commented 1 month ago

I'd like to use some bugfixes from later versions, so how about we make the version dynamic in ScalafmtModule?

scalafmt-dynamic-3.7.15 is dynamically using the scalafmt version specified in .scalafmt.conf. So you should be able to use whatever newer version you want. That's the point of using scalafmt-dynamic with a config file over a configuration inside build.sc.

pieter-bos commented 1 month ago

I see! I tried this earlier and it had no effect then, but it's working now, so I must have missed something. Sorry for the PR noise!

lefou commented 1 month ago

No problem and thanks for your contribution!

If you find that our documentation could be improved, feel free to open another PR!