scalacenter / scalafix

Refactoring and linting tool for Scala
https://scalacenter.github.io/scalafix/
BSD 3-Clause "New" or "Revised" License
830 stars 186 forks source link

Remove evil global cache for compiling rules #782

Open olafurpg opened 6 years ago

olafurpg commented 6 years ago

Scalafix uses a global mutable cache for compiling rules https://github.com/scalacenter/scalafix/blob/6a0c120ce3e917acdb10e8ad4e69f52b26d468eb/scalafix-reflect/src/main/scala/scalafix/internal/reflect/ScalafixToolbox.scala#L23-L26

We should replace this cache by requiring end-users to instantiate an instance of "Scalafix API". This gives end-users control over when to clear/start caching results.

bplommer commented 3 years ago

I'd also settle for an sbt command to flush the cache.