Skip to content

Commit 7a5466e

Browse files
author
Vincent Potucek
committed
[prone] remove disable warning leftover finalize convention principle
Signed-off-by: Vincent Potucek <[email protected]>
1 parent b822a12 commit 7a5466e

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

gradle/plugins/common/src/main/kotlin/junitbuild.java-errorprone-conventions.gradle.kts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import junitbuild.extensions.dependencyFromLibs
22
import net.ltgt.gradle.errorprone.errorprone
33
import net.ltgt.gradle.nullaway.nullaway
4+
import org.gradle.jvm.toolchain.JvmImplementation.J9
45

56
plugins {
67
`java-library`
@@ -16,17 +17,10 @@ dependencies {
1617

1718
tasks.withType<JavaCompile>().configureEach {
1819
options.errorprone {
19-
val shouldDisableErrorProne = java.toolchain.implementation.orNull == JvmImplementation.J9
20-
if (name == "compileJava" && !shouldDisableErrorProne) {
21-
disable(
22-
"AnnotateFormatMethod", // We don`t want to use ErrorProne's annotations.
23-
"BadImport", // This check is opinionated wrt. which method names it considers unsuitable for import which includes a few of our own methods in `ReflectionUtils` etc.
24-
"DoNotCallSuggester", // We don`t want to use ErrorProne's annotations.
25-
"ImmutableEnumChecker", // We don`t want to use ErrorProne's annotations.
26-
"InlineMeSuggester", // We don`t want to use ErrorProne's annotations.
27-
"MissingSummary", // Produces a lot of findings that we consider to be false positives, for example for package-private classes and methods.
28-
"StringSplitter", // We don`t want to use Guava.
29-
"UnnecessaryLambda", // The findings of this check are subjective because a named constant can be more readable in many cases.
20+
val enableErrorProne = java.toolchain.implementation.orNull != J9
21+
if (name == "compileJava" && enableErrorProne) {
22+
disableAllWarnings = true // considering this immense spam burden, remove this once to fix dedicated flaw. https://github.com/diffplug/spotless/pull/2766
23+
disable( // We don`t want to use ErrorProne's annotations.
3024
// picnic (https://error-prone.picnic.tech)
3125
"ConstantNaming",
3226
"DirectReturn", // We don`t want to use this: https://github.com/junit-team/junit-framework/pull/5006#discussion_r2403984446
@@ -45,18 +39,22 @@ tasks.withType<JavaCompile>().configureEach {
4539
error(
4640
"CanonicalAnnotationSyntax",
4741
"IsInstanceLambdaUsage",
42+
"MissingOverride",
4843
"PackageLocation",
4944
"RedundantStringConversion",
5045
"RedundantStringEscape",
46+
"SelfAssignment",
47+
"StringCharset",
48+
"StringJoin",
5149
)
5250
} else {
5351
disableAllChecks = true
5452
}
5553
nullaway {
56-
if (shouldDisableErrorProne) {
57-
disable()
58-
} else {
54+
if (enableErrorProne) {
5955
enable()
56+
} else {
57+
disable()
6058
}
6159
onlyNullMarked = true
6260
isJSpecifyMode = true

0 commit comments

Comments
 (0)