Skip to content
Gradle plugin to apply WartRemover (Scala linting tool)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
LICENSE
README.md
_config.yml
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Gradle WartRemover Plugin

Build Status Download

Gradle plugin to apply WartRemover, the Scala linting tool.

It applies the WartRemover plugin with same settings to all ScalaCompile tasks, so even the test code is checked.

"Keep your tests clean. Treat them as first-class citizens of the system." Robert C. Martin (Uncle Bob)

If you want to have different settings for tests then you can use the test block as shown below. If you don't use test block then all the settings is applied to all the Scala code.

Usage

buildscript {
	repositories {
		jcenter()
	}
	dependencies {
		classpath 'cz.augi:gradle-wartremover:putCurrentVersionHere'
	}
}

apply plugin: 'wartremover'

wartremover {
    errorWarts.add('Product') // set of warts to use - violation causes error; default is empty set
    warningWarts.add('Product') // set of warts to use - violation causes warning; default is set of all stable warts
    excludedFiles.add('src/main/scala/me/project/Main.scala') // set of file to be excluded; default is empty
    test {
        errorWarts.add('Serializable') // set of warts to use - violation causes error; default settings from the block above
        warningWarts.add('Serializable') // set of warts to use - violation causes warning; default settings from the block above
        excludedFiles.add('src/test/scala/me/project/Test.scala') // set of file to be excluded; default settings from the block above
    }
}

The plugin can be also applied using the new Gradle syntax:

plugins {
  id 'cz.augi.gradle.wartremover' version 'putCurrentVersionHere'
}
You can’t perform that action at this time.