Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Add and configure sbt-wartremover #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC3")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.3")

scalafmtOnCompile := true

wartremoverWarnings in (Compile, compile) ++= Warts.unsafe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds settings for the wart remover configuration of the plugin itself.
I think we want to add settings to projects using the plugin via the projectSettings method of ScalazPlugin

1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libraryDependencies += { "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value }
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC3")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.2.1")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.1.6
6 changes: 6 additions & 0 deletions src/sbt-test/scalaz-sbt/wartremover/project/test.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
val pluginVersion =
sys.props
.get("plugin.version")
.getOrElse(sys.error("Sys prop plugin.version must be defined!"))

addSbtPlugin("org.scalaz" % "scalaz-sbt" % pluginVersion)
3 changes: 3 additions & 0 deletions src/sbt-test/scalaz-sbt/wartremover/src/main/scala/Test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
object Test {
def foo(a: String, b: Int): String = b + a
}
4 changes: 4 additions & 0 deletions src/sbt-test/scalaz-sbt/wartremover/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Verify that the sbt-wartremover plugin is correctly activated

> clean
> compile
3 changes: 3 additions & 0 deletions src/sbt-test/scalaz-sbt/wartremover/test.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enablePlugins(ScalazPlugin)

name := "wartremover"