joan38 / mill-scalafix

A Scalafix plugin for Mill build tool
MIT License
32 stars 17 forks source link

Cache Scalafix instances globally #206

Closed lolgab closed 1 month ago

lolgab commented 1 month ago

Fixes https://github.com/joan38/mill-scalafix/issues/175

lolgab commented 1 month ago

@bjaglin Do you mind reviewing it?

lolgab commented 1 month ago

@lefou Maybe if I make it a Worker it can be cleaned thanks to https://github.com/com-lihaoyi/mill/pull/3579 ? What do you think?

lolgab commented 1 month ago

Oh but fixAction is not a Task. I'm going to merge and release as is. Then for 0.5 we could think about making fixAction a task.

lefou commented 1 month ago

@lolgab Yeah, a Worker which returns a AutoClosable is the go-to solution. Since you share the `Scalafix instances, you probably need some reference counting, too, to not close instances still in use.