import sbt._
import sbt.Keys._
import wartremover.WartRemover.autoImport._
import wartremover.Wart

object CodeAnalysis {

  lazy val disable = Seq(
    wartremoverErrors in (Compile, compile) := Seq.empty,
    wartremoverErrors in (Test, compile) := Seq.empty
  )

  lazy val settings = Seq(
    wartremoverErrors in (Compile, compile) := Warts.allBut(disabledWarts: _*),
    wartremoverErrors in (Test, compile) := (wartremoverErrors in (Compile, compile)).value
  )

  private def disabledWarts: List[Wart] =
    List(
      Wart.AsInstanceOf,
      Wart.Any,
      Wart.Equals,
      Wart.ImplicitConversion,
      Wart.ImplicitParameter,
      Wart.JavaSerializable,
      Wart.MutableDataStructures,
      Wart.NonUnitStatements,
      Wart.Nothing,
      Wart.Null,
      Wart.Overloading,
      Wart.OptionPartial, // Generated by boopickle macros
      Wart.StringPlusAny, // see https://github.com/wartremover/wartremover/issues/447
      Wart.Throw,
      Wart.ToString,
      Wart.TraversableOps,
      Wart.Var,
      Wart.While
    )
}

import sbt._
import sbt.Keys._
import wartremover.WartRemover.autoImport._
import wartremover.Wart

object CodeAnalysis {

  lazy val disable = Seq(
    wartremoverErrors in (Compile, compile) := Seq.empty,
    wartremoverErrors in (Test, compile) := Seq.empty
  )

  lazy val settings = Seq(
    wartremoverErrors in (Compile, compile) := Warts.allBut(disabledWarts: _*),
    wartremoverErrors in (Test, compile) := (wartremoverErrors in (Compile, compile)).value
  )

  private def disabledWarts: List[Wart] =
    List(
      Wart.AsInstanceOf,
      Wart.Any,
      Wart.Equals,
      Wart.ImplicitConversion,
      Wart.ImplicitParameter,
      Wart.JavaSerializable,
      Wart.MutableDataStructures,
      Wart.NonUnitStatements,
      Wart.Nothing,
      Wart.Null,
      Wart.Overloading,
      Wart.OptionPartial, // Generated by boopickle macros
      Wart.Serializable, // breaks JMS's Serializable usage, looks like a bug
      Wart.StringPlusAny, // see https://github.com/wartremover/wartremover/issues/447
      Wart.Throw,
      Wart.ToString,
      Wart.TraversableOps,
      Wart.Var,
      Wart.While
    )
}

Disable buggy wartremover Serializable that messed up JMS legit usage
Disable buggy wartremover Serializable that messed up JMS legit usage
