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 0e72f24  [SPARK-52555] Enforce `UnusedLocalVariable` rule
0e72f24 is described below

commit 0e72f248150aa6b5cce860852a5f929a21666dda
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Jun 23 16:07:25 2025 -0700

    [SPARK-52555] Enforce `UnusedLocalVariable` rule
    
    ### What changes were proposed in this pull request?
    
    This PR aims to enforce `UnusedLocalVariable` rule.
    
    ### Why are the changes needed?
    
    To keep the code quality rule.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #254 from dongjoon-hyun/SPARK-52555.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 config/pmd/ruleset.xml                                                   | 1 -
 .../src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java   | 1 +
 .../org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java | 1 +
 .../java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java | 1 +
 4 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/config/pmd/ruleset.xml b/config/pmd/ruleset.xml
index 48ffdeb..17aa102 100644
--- a/config/pmd/ruleset.xml
+++ b/config/pmd/ruleset.xml
@@ -26,7 +26,6 @@
     <exclude name="ImplicitFunctionalInterface" />
     <exclude name="UnitTestAssertionsShouldIncludeMessage" />
     <exclude name="UnitTestContainsTooManyAsserts" />
-    <exclude name="UnusedLocalVariable" />
     <exclude name="LooseCoupling" />
   </rule>
   <rule ref="category/java/codestyle.xml">
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java
index 0016684..ca3b285 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java
@@ -142,6 +142,7 @@ class SparkOperatorTest {
     }
   }
 
+  @SuppressWarnings("PMD.UnusedLocalVariable")
   @Test
   void testUpdateWatchedNamespacesWithDynamicConfigEnabled() {
     MetricsSystem mockMetricsSystem = mock(MetricsSystem.class);
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
index dedf067..d589765 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
@@ -85,6 +85,7 @@ class SparkAppReconcilerTest {
         .appendNewStateAndPersist(any(SparkAppContext.class), 
any(ApplicationState.class));
   }
 
+  @SuppressWarnings("PMD.UnusedLocalVariable")
   @Test
   void testCleanupRunningApp() {
     try (MockedConstruction<SparkAppContext> mockAppContext =
diff --git 
a/spark-submission-worker/src/test/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java
 
b/spark-submission-worker/src/test/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java
index 9c50bfb..b41f99a 100644
--- 
a/spark-submission-worker/src/test/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java
+++ 
b/spark-submission-worker/src/test/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java
@@ -49,6 +49,7 @@ import 
org.apache.spark.k8s.operator.status.ApplicationAttemptSummary;
 import org.apache.spark.k8s.operator.status.ApplicationStatus;
 import org.apache.spark.k8s.operator.status.AttemptInfo;
 
+@SuppressWarnings("PMD.UnusedLocalVariable")
 class SparkAppSubmissionWorkerTest {
   @Test
   void buildDriverConfShouldApplySpecAndPropertiesOverride() {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to