title: How can I create a separate sbt Configuration or Task to compile with WartRemover?
body: <p><a href="https://github.com/puffnfresh/wartremover" rel="noreferrer">WartRemover</a> is a scalac plugin. Typically it is configured via an <a href="https://github.com/puffnfresh/wartremover/blob/master/sbt-plugin/src/main/scala/wartremover/package.scala" rel="noreferrer">sbt plugin</a>.</p>
  
  <p>I'd like to be able to run WartRemover on my sbt project as a separate configuration or task without affecting the usual run of <code>compile</code>. </p>
  
  <p>After adding Wartremover to my <code>plugins.sbt</code> I tried quite a few variations on the following. </p>
  
  <pre><code>lazy val Lint = config("lint").extend(Compile)
  
  project("foo").
    configs(Lint)
    settings(inConfig(Lint)(Defaults.compileSettings): _*).
    settings(inConfig(Linting)(wartremover.wartremoverSettings):_*).
    settings(inConfig(Linting)(wartremover.wartremoverErrors := wartremover.Warts.all))
  </code></pre>
  
  <p>Afterward <code>scalacOptions</code> contained roughly what I expected inside my new <code>lint</code> configuration and in the <code>compile</code> configuration. However, when I ran <code>lint:compile</code> and <code>compile</code> with sbt in debug mode so I could see the command line arguments to scalac, either both or neither commands would result in pass the <code>-P:wartremover:...</code> switches. That was surprising because only <code>lint:scalacOptions</code> showed the <code>-P:wartremover:...</code> switches.</p>
  
  <p>How can I create a separate sbt Configuration or Task to compile with WartRemover without affecting <code>compile:compile</code>?</p>