Skip to content

Commit ca7bac4

Browse files
honnixclaude
andcommitted
chore: remove SpotBugs
SpotBugs is not providing value. Remove the plugin, config, and exclusion file. Convert the workaround in SerializeWorkflows to use try-with-resources. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Hongxin Liang <honnix@users.noreply.github.com>
1 parent 71d676e commit ca7bac4

7 files changed

Lines changed: 1 addition & 127 deletions

File tree

flytekit-examples-scala/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
<name>Flytekit Java Examples in Scala</name>
3030
<description>Examples of Tasks, Workflows and Launch plans written in Scala.</description>
3131

32-
<properties>
33-
<!-- spotbugs doesn't understand Scala code -->
34-
<spotbugs.skip>true</spotbugs.skip>
35-
</properties>
36-
3732
<dependencyManagement>
3833
<dependencies>
3934
<dependency>

flytekit-scala-tests/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
macro expansion that can't be done
3333
in the same module.</description>
3434

35-
<properties>
36-
<!-- spotbugs doesn't understand Scala code -->
37-
<spotbugs.skip>true</spotbugs.skip>
38-
</properties>
39-
4035
<dependencyManagement>
4136
<dependencies>
4237
<dependency>

flytekit-scala_2.12/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<description>Classes used by developers to build Flyte's Tasks, Workflows and Launch plans in
3232
Scala 2.12.</description>
3333

34-
<properties>
35-
<!-- spotbugs doesn't understand Scala code -->
36-
<spotbugs.skip>true</spotbugs.skip>
37-
</properties>
38-
3934
<dependencyManagement>
4035
<dependencies>
4136
<dependency>

flytekit-scala_2.13/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<description>Classes used by developers to build Flyte's Tasks, Workflows and Launch plans in
3232
Scala 2.13.</description>
3333

34-
<properties>
35-
<!-- spotbugs doesn't understand Scala code -->
36-
<spotbugs.skip>true</spotbugs.skip>
37-
</properties>
38-
3934
<dependencyManagement>
4035
<dependencies>
4136
<dependency>

jflyte/src/main/java/org/flyte/jflyte/SerializeWorkflows.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static org.flyte.jflyte.utils.TokenSourceFactoryLoader.getTokenSource;
2020

21-
import com.google.errorprone.annotations.Var;
2221
import com.google.protobuf.ByteString;
2322
import java.io.File;
2423
import java.io.FileOutputStream;
@@ -102,23 +101,11 @@ public Integer call() {
102101

103102
private static BiConsumer<String, ByteString> fileWriter(String folder) {
104103
return (filename, bytes) -> {
105-
@Var FileOutputStream fos = null;
106-
107-
// ugly because spotbugs doesn't like try-with-resources
108-
try {
109-
fos = new FileOutputStream(new File(folder, filename));
104+
try (FileOutputStream fos = new FileOutputStream(new File(folder, filename))) {
110105
bytes.writeTo(fos);
111106
fos.flush();
112107
} catch (IOException e) {
113108
throw new UncheckedIOException("failed to write to " + folder + "/" + filename, e);
114-
} finally {
115-
if (fos != null) {
116-
try {
117-
fos.close();
118-
} catch (IOException e) {
119-
// ignore, any significant error should happen during flush
120-
}
121-
}
122109
}
123110
};
124111
}

pom.xml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
<sl4j.version>1.7.36</sl4j.version>
108108
<!-- also remember to bump the version in flytekit-bom module -->
109109
<spotless.version>2.21.0</spotless.version>
110-
<spotbugs.excludeFilterFile>spotbugs-exclude.xml</spotbugs.excludeFilterFile>
111110
<error_prone.version>2.27.0</error_prone.version>
112111
<junit.version>5.7.0</junit.version>
113112

@@ -593,26 +592,6 @@
593592
</execution>
594593
</executions>
595594
</plugin>
596-
<plugin>
597-
<groupId>com.github.spotbugs</groupId>
598-
<artifactId>spotbugs-maven-plugin</artifactId>
599-
<version>4.2.3</version>
600-
<configuration>
601-
<includeTests>true</includeTests>
602-
<effort>Max</effort>
603-
<threshold>Low</threshold>
604-
<failOnError>true</failOnError>
605-
<xmlOutput>true</xmlOutput>
606-
</configuration>
607-
<executions>
608-
<execution>
609-
<goals>
610-
<goal>check</goal>
611-
</goals>
612-
<phase>verify</phase>
613-
</execution>
614-
</executions>
615-
</plugin>
616595
<plugin>
617596
<artifactId>maven-javadoc-plugin</artifactId>
618597
<version>3.3.1</version>
@@ -766,10 +745,6 @@
766745
<groupId>com.diffplug.spotless</groupId>
767746
<artifactId>spotless-maven-plugin</artifactId>
768747
</plugin>
769-
<plugin>
770-
<groupId>com.github.spotbugs</groupId>
771-
<artifactId>spotbugs-maven-plugin</artifactId>
772-
</plugin>
773748
<plugin>
774749
<groupId>org.apache.rat</groupId>
775750
<artifactId>apache-rat-plugin</artifactId>

spotbugs-exclude.xml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)