This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 97d681f [SPARK-52137] Upgrade `pmd` to 7.13.0
97d681f is described below
commit 97d681f15b3a087a8b70395cf5d1e760a1cb128c
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed May 14 11:26:53 2025 -0700
[SPARK-52137] Upgrade `pmd` to 7.13.0
### What changes were proposed in this pull request?
This PR aims to upgrade `pmd` from `6.55.0` to `7.13.0`.
### Why are the changes needed?
We had better upgrade to prevent the future regressions because there are
many improvements in PMD 7.x.
- https://pmd.github.io/2024/03/22/PMD-7-is-here/
### Does this PR introduce _any_ user-facing change?
No behavior change.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #200 from dongjoon-hyun/SPARK-52137.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../org/apache/spark/k8s/operator/utils/DocTable.java | 3 +--
config/pmd/ruleset.xml | 19 +++++++++++++++++--
gradle/libs.versions.toml | 2 +-
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git
a/build-tools/docs-utils/src/main/java/org/apache/spark/k8s/operator/utils/DocTable.java
b/build-tools/docs-utils/src/main/java/org/apache/spark/k8s/operator/utils/DocTable.java
index 73e0597..ab51487 100644
---
a/build-tools/docs-utils/src/main/java/org/apache/spark/k8s/operator/utils/DocTable.java
+++
b/build-tools/docs-utils/src/main/java/org/apache/spark/k8s/operator/utils/DocTable.java
@@ -57,8 +57,7 @@ public class DocTable {
private String joinRow(List<String> elements) {
StringBuilder stringBuilder = new StringBuilder(ROW_SEPARATOR);
for (String element : elements) {
- stringBuilder.append(element);
- stringBuilder.append(ROW_SEPARATOR);
+ stringBuilder.append(element).append(ROW_SEPARATOR);
}
if (elements.size() < columns) {
// Append empty cells to end if needed
diff --git a/config/pmd/ruleset.xml b/config/pmd/ruleset.xml
index 3f75485..0f97d1b 100644
--- a/config/pmd/ruleset.xml
+++ b/config/pmd/ruleset.xml
@@ -22,8 +22,13 @@
Apache Spark Kubernetes Operator Ruleset
</description>
<rule ref="category/java/bestpractices.xml">
- <exclude name="JUnitAssertionsShouldIncludeMessage" />
- <exclude name="JUnitTestContainsTooManyAsserts" />
+ <exclude name="GuardLogStatement" />
+ <exclude name="ImplicitFunctionalInterface" />
+ <exclude name="UnitTestAssertionsShouldIncludeMessage" />
+ <exclude name="UnitTestContainsTooManyAsserts" />
+ <exclude name="UnitTestShouldIncludeAssert" />
+ <exclude name="UnusedLocalVariable" />
+ <exclude name="LooseCoupling" />
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor" />
@@ -36,16 +41,24 @@
<exclude name="OnlyOneReturn" />
<exclude name="ShortVariable" />
<exclude name="TooManyStaticImports" />
+ <exclude name="UnnecessaryCast" />
+ <exclude name="UnnecessaryFullyQualifiedName" />
+ <exclude name="UseExplicitTypes" />
<exclude name="UseUnderscoresInNumericLiterals" />
</rule>
<rule ref="category/java/design.xml">
<exclude name="AbstractClassWithoutAnyMethod" />
<exclude name="AvoidCatchingGenericException" />
+ <exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
<exclude name="CognitiveComplexity" />
+ <exclude name="CouplingBetweenObjects" />
<exclude name="CyclomaticComplexity" />
+ <exclude name="DataClass" />
<exclude name="ExcessiveImports" />
+ <exclude name="FinalFieldCouldBeStatic" />
<exclude name="LawOfDemeter" />
<exclude name="NPathComplexity" />
+ <exclude name="SimplifyBooleanReturns" />
<exclude name="TooManyMethods" />
</rule>
<rule ref="category/java/documentation.xml">
@@ -67,6 +80,7 @@
<exclude name="UseProperClassLoader" />
</rule>
<rule ref="category/java/multithreading.xml">
+ <exclude name="AvoidSynchronizedStatement" />
<exclude name="DoNotUseThreads" />
<exclude name="UseConcurrentHashMap" />
</rule>
@@ -74,6 +88,7 @@
<exclude name="AvoidFileStream" />
<exclude name="AvoidInstantiatingObjectsInLoops" />
<exclude name="RedundantFieldInitializer" />
+ <exclude name="UseArraysAsList" />
</rule>
<rule ref="category/java/security.xml"/>
<!-- exclude on generated files -->
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c118f67..47a89b4 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -30,7 +30,7 @@ mockito = "5.17.0"
# Build Analysis
checkstyle = "10.23.1"
-pmd = "6.55.0"
+pmd = "7.13.0"
spotbugs-tool = "4.8.6"
spotbugs-plugin = "6.0.17"
spotless-plugin = "6.25.0"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]