From 7901c6422c9d92d522eacf6951c7bb024ec502f0 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sun, 3 Dec 2023 14:37:38 +0800 Subject: [PATCH] SpotBugs Gradle plugin v6 https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/6.0.0 https://github.com/spotbugs/spotbugs-gradle-plugin/blob/53f780917d10293098a766f0b568a4fcf0c4cc03/src/main/kotlin/com/github/spotbugs/snom/Confidence.kt#L45-L64 --- gradle/java-setup.gradle | 3 ++- lib-extra/build.gradle | 5 ++++- lib/build.gradle | 5 ++++- settings.gradle | 2 +- testlib/build.gradle | 5 ++++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gradle/java-setup.gradle b/gradle/java-setup.gradle index b152097653..6663447ba4 100644 --- a/gradle/java-setup.gradle +++ b/gradle/java-setup.gradle @@ -15,7 +15,8 @@ tasks.withType(JavaCompile).configureEach { apply plugin: 'com.github.spotbugs' spotbugs { ignoreFailures = false // bug free or it doesn't ship! - reportLevel = 'medium' // low|medium|high (low = sensitive to even minor mistakes) + // LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes). + reportLevel = com.github.spotbugs.snom.Confidence.valueOf('MEDIUM') omitVisitors = [ // https://spotbugs.readthedocs.io/en/latest/detectors.html#constructorthrow 'ConstructorThrow', diff --git a/lib-extra/build.gradle b/lib-extra/build.gradle index e6524f76bf..a7a8a0d39f 100644 --- a/lib-extra/build.gradle +++ b/lib-extra/build.gradle @@ -91,5 +91,8 @@ p2deps { } // we'll hold the core lib to a high standard -spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes) +spotbugs { + // LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes). + reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW') +} diff --git a/lib/build.gradle b/lib/build.gradle index a3424a7ee9..6dcb888e73 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -126,7 +126,10 @@ dependencies { } // we'll hold the core lib to a high standard -spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes) +spotbugs { + // LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes). + reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW') +} apply from: rootProject.file('gradle/special-tests.gradle') tasks.withType(Test).configureEach { diff --git a/settings.gradle b/settings.gradle index e7e5a6d4ea..ff03ca6ca3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,7 +12,7 @@ plugins { // https://github.com/gradle-nexus/publish-plugin/releases id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false // https://github.com/spotbugs/spotbugs-gradle-plugin/releases - id 'com.github.spotbugs' version '5.2.3' apply false + id 'com.github.spotbugs' version '6.0.1' apply false // https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md id 'com.diffplug.spotless-changelog' version '3.0.2' apply false // https://github.com/diffplug/goomph/blob/main/CHANGES.md diff --git a/testlib/build.gradle b/testlib/build.gradle index a4c83cfdf4..ce36b83adb 100644 --- a/testlib/build.gradle +++ b/testlib/build.gradle @@ -21,7 +21,10 @@ dependencies { } // we'll hold the testlib to a low standard (prize brevity) -spotbugs { reportLevel = 'high' } // low|medium|high (low = sensitive to even minor mistakes) +spotbugs { + // LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes). + reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH') +} apply from: rootProject.file('gradle/special-tests.gradle') tasks.withType(Test).configureEach {