Skip to content

Commit 0e72f24

Browse files
committed
[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]>
1 parent c95ed16 commit 0e72f24

File tree

4 files changed

+3
-1
lines changed

4 files changed

+3
-1
lines changed

config/pmd/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<exclude name="ImplicitFunctionalInterface" />
2727
<exclude name="UnitTestAssertionsShouldIncludeMessage" />
2828
<exclude name="UnitTestContainsTooManyAsserts" />
29-
<exclude name="UnusedLocalVariable" />
3029
<exclude name="LooseCoupling" />
3130
</rule>
3231
<rule ref="category/java/codestyle.xml">

spark-operator/src/test/java/org/apache/spark/k8s/operator/SparkOperatorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void testOperatorConstructionWithDynamicConfigDisabled() {
142142
}
143143
}
144144

145+
@SuppressWarnings("PMD.UnusedLocalVariable")
145146
@Test
146147
void testUpdateWatchedNamespacesWithDynamicConfigEnabled() {
147148
MetricsSystem mockMetricsSystem = mock(MetricsSystem.class);

spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void beforeEach() {
8585
.appendNewStateAndPersist(any(SparkAppContext.class), any(ApplicationState.class));
8686
}
8787

88+
@SuppressWarnings("PMD.UnusedLocalVariable")
8889
@Test
8990
void testCleanupRunningApp() {
9091
try (MockedConstruction<SparkAppContext> mockAppContext =

spark-submission-worker/src/test/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorkerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.apache.spark.k8s.operator.status.ApplicationStatus;
5050
import org.apache.spark.k8s.operator.status.AttemptInfo;
5151

52+
@SuppressWarnings("PMD.UnusedLocalVariable")
5253
class SparkAppSubmissionWorkerTest {
5354
@Test
5455
void buildDriverConfShouldApplySpecAndPropertiesOverride() {

0 commit comments

Comments
 (0)