sbt-scapegoat icon indicating copy to clipboard operation
sbt-scapegoat copied to clipboard

How do I make `sbt scapegoat` not run `scapegoatClean`?

Open GordonGustafson opened this issue 8 years ago • 4 comments

Currently when I run sbt scapegoat it recompiles and reanalyzes my entire project. I want it to only analyze what was already going to be recompiled. I added scapegoatRunAlways := false to my build.sbt because it's documented as doing exactly what I want. It had no effect, and looking at the source for this project I see that it only affects the behavior of scapegoatCleanTask, which can only be invoked manually.

I found this in the source:

  (compile in Scapegoat) <<= (compile in Scapegoat) dependsOn scapegoatClean,
  scapegoat := (compile in Scapegoat).value,

Since scapegoat depends on scapegoatClean, what I want seems to be impossible. The top line were changed to use scapegoatCleanTask (which respects scapegoatRunAlways) instead of scapegoatClean, all would be well.

  (compile in Scapegoat) <<= (compile in Scapegoat) dependsOn scapegoatCleanTask,

GordonGustafson avatar Mar 09 '16 04:03 GordonGustafson

Yes it does clean on each run. That was part of the design so you get a full picture. I guess the devils advocate argument against your question is that if you only evaluate incrementally, it will lose the previous "errors"

sksamuel avatar Mar 09 '16 23:03 sksamuel

Cleaning by default on each run is fine. I just want to be able to configure it to not clean on each run. If the impotency of scapegoatRunAlways isn't considered a bug, is there any way I can achieve it's intended purpose of not cleaning on each run?

GordonGustafson avatar Mar 10 '16 00:03 GordonGustafson

It can be changed to support what you want.

On 10 March 2016 at 00:07, Gordon Gustafson [email protected] wrote:

Cleaning by default on each run is fine. I just want to be able to configure it to not clean on each run. If the impotency of scapegoatRunAlways isn't considered a bug, is there any way I can achieve it's intended purpose of not cleaning on each run?

— Reply to this email directly or view it on GitHub https://github.com/sksamuel/sbt-scapegoat/issues/39#issuecomment-194579292 .

sksamuel avatar Mar 14 '16 20:03 sksamuel

Related: https://github.com/sksamuel/sbt-scapegoat/issues/31

dskrvk avatar Nov 04 '16 03:11 dskrvk