Skip to content

Commit 2289389

Browse files
LuciferYangHyukjinKwon
authored andcommitted
[SPARK-33441][BUILD][FOLLOWUP] Make unused-imports check for SBT specific
### What changes were proposed in this pull request? Move "unused-imports" check config to `SparkBuild.scala` and make it SBT specific. ### Why are the changes needed? Make unused-imports check for SBT specific. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass the Jenkins or GitHub Action Closes #30441 from LuciferYang/SPARK-33441-FOLLOWUP. Authored-by: yangjie01 <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
1 parent 8218b48 commit 2289389

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pom.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
<commons.collections.version>3.2.2</commons.collections.version>
165165
<scala.version>2.12.10</scala.version>
166166
<scala.binary.version>2.12</scala.binary.version>
167-
<scalac.arg.unused-imports>-Ywarn-unused-import</scalac.arg.unused-imports>
168167
<scalatest-maven-plugin.version>2.0.0</scalatest-maven-plugin.version>
169168
<scalafmt.parameters>--test</scalafmt.parameters>
170169
<!-- for now, not running scalafmt as part of default verify pipeline -->
@@ -2538,7 +2537,6 @@
25382537
<arg>-deprecation</arg>
25392538
<arg>-feature</arg>
25402539
<arg>-explaintypes</arg>
2541-
<arg>${scalac.arg.unused-imports}</arg>
25422540
<arg>-target:jvm-1.8</arg>
25432541
</args>
25442542
<jvmArgs>
@@ -3262,13 +3260,12 @@
32623260
</pluginManagement>
32633261
</build>
32643262
</profile>
3265-
3263+
32663264
<profile>
32673265
<id>scala-2.13</id>
32683266
<properties>
32693267
<scala.version>2.13.3</scala.version>
32703268
<scala.binary.version>2.13</scala.binary.version>
3271-
<scalac.arg.unused-imports>-Wconf:cat=unused-imports:e</scalac.arg.unused-imports>
32723269
</properties>
32733270
<dependencyManagement>
32743271
<dependencies>

project/SparkBuild.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ object SparkBuild extends PomBuild {
221221
Seq(
222222
"-Xfatal-warnings",
223223
"-deprecation",
224+
"-Ywarn-unused-import",
224225
"-P:silencer:globalFilters=.*deprecated.*" //regex to catch deprecation warnings and supress them
225226
)
226227
} else {
@@ -230,6 +231,8 @@ object SparkBuild extends PomBuild {
230231
// see `scalac -Wconf:help` for details
231232
"-Wconf:cat=deprecation:wv,any:e",
232233
// 2.13-specific warning hits to be muted (as narrowly as possible) and addressed separately
234+
// TODO(SPARK-33499): Enable this option when Scala 2.12 is no longer supported.
235+
// "-Wunused:imports",
233236
"-Wconf:cat=lint-multiarg-infix:wv",
234237
"-Wconf:cat=other-nullary-override:wv",
235238
"-Wconf:cat=other-match-analysis&site=org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction.catalogFunction:wv",

0 commit comments

Comments
 (0)