scalafix icon indicating copy to clipboard operation
scalafix copied to clipboard

sbt: scalafixEnable resets sbt session settings

Open tuures opened this issue 6 years ago • 2 comments
trafficstars

Running scalafixEnable resets all configuration changes that were done in sbt console (in the session).

For example if I modify scalacOptions (set scalacOptions in ThisBuild := ...) and then run scalafixEnable, the scalacOptions are reseted back to the project configuration, which unexpected and very inconvenient.

I suspect this is because here:

https://github.com/scalacenter/sbt-scalafix/blob/e171dca59d8fc3fd3fee2997dfc2634634ecfa10/src/main/scala-sbt-1.0/sbt/internal/sbtscalafix/Compat.scala#L14

appendWithoutSession is used instead of appendWithSession. Is there something that would prevent from using appendWithSession?

tuures avatar Oct 04 '19 13:10 tuures

appendWithoutSession is used instead of appendWithSession. Is there something that would prevent from using appendWithSession?

I don't think so, feel free to open a PR!

bjaglin avatar Nov 04 '20 11:11 bjaglin

Because of https://github.com/sbt/sbt/issues/5459, the suggested change might not be enough.

bjaglin avatar Mar 02 '21 17:03 bjaglin