Skip to content

Commit

Permalink
Upgrade error-prone's EqualsHashCode and EqualsIncompatibleType from …
Browse files Browse the repository at this point in the history
…Warn -> Error (#298)

Fixes #297

Enables [`EqualsHashCode`](http://errorprone.info/bugpattern/EqualsHashCode) and [`EqualsIncompatibleType`](http://errorprone.info/bugpattern/EqualsIncompatibleType) as `ERROR` for Errorprone.
  • Loading branch information
mnazbro authored and iamdanfox committed Jul 3, 2018
1 parent 25d18c9 commit 9842aa6
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.palantir.baseline.plugins
import net.ltgt.gradle.errorprone.ErrorPronePlugin
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.tasks.compile.JavaCompile

class BaselineErrorProne extends AbstractBaselinePlugin {

Expand All @@ -30,6 +31,14 @@ class BaselineErrorProne extends AbstractBaselinePlugin {
// TODO(rfink): This is somewhat ugly. Is there a better to add the processor dependency on the library?
errorprone "com.palantir.baseline:baseline-error-prone:${extractVersionString()}"
}

project.tasks.withType(JavaCompile) {
options.compilerArgs += [
"-XepDisableWarningsInGeneratedCode",
"-Xep:EqualsHashCode:ERROR",
"-Xep:EqualsIncompatibleType:ERROR",
]
}
}

private String extractVersionString() {
Expand Down

0 comments on commit 9842aa6

Please sign in to comment.