Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import scala.collection.JavaConverters._
import scala.collection.Map
import scala.collection.immutable
import scala.collection.mutable.HashMap
import scala.collection.mutable.HashSet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for testing right?

Copy link
Contributor Author

@LuciferYang LuciferYang Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expect this line to trigger compile error

Copy link
Contributor Author

@LuciferYang LuciferYang Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Looks like it's working in Scala 2.12 , but seems -Wconf:cat=unused-imports:e not working in Scala 2.13

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
-Wunused:imports working in Scala 2.13

import scala.language.implicitConversions
import scala.reflect.{classTag, ClassTag}
import scala.util.control.NonFatal
Expand Down
5 changes: 1 addition & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
<commons.collections.version>3.2.2</commons.collections.version>
<scala.version>2.12.10</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<scalac.arg.unused-imports>-Ywarn-unused-import</scalac.arg.unused-imports>
<scalatest-maven-plugin.version>2.0.0</scalatest-maven-plugin.version>
<scalafmt.parameters>--test</scalafmt.parameters>
<!-- for now, not running scalafmt as part of default verify pipeline -->
Expand Down Expand Up @@ -2538,7 +2537,6 @@
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-explaintypes</arg>
<arg>${scalac.arg.unused-imports}</arg>
<arg>-target:jvm-1.8</arg>
</args>
<jvmArgs>
Expand Down Expand Up @@ -3262,13 +3260,12 @@
</pluginManagement>
</build>
</profile>

<profile>
<id>scala-2.13</id>
<properties>
<scala.version>2.13.3</scala.version>
<scala.binary.version>2.13</scala.binary.version>
<scalac.arg.unused-imports>-Wconf:cat=unused-imports:e</scalac.arg.unused-imports>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
2 changes: 2 additions & 0 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ object SparkBuild extends PomBuild {
Seq(
"-Xfatal-warnings",
"-deprecation",
"Ywarn-unused-import",
"-P:silencer:globalFilters=.*deprecated.*" //regex to catch deprecation warnings and supress them
)
} else {
Expand All @@ -230,6 +231,7 @@ object SparkBuild extends PomBuild {
// see `scalac -Wconf:help` for details
"-Wconf:cat=deprecation:wv,any:e",
// 2.13-specific warning hits to be muted (as narrowly as possible) and addressed separately
"-Wconf:cat=unused-imports:e",
"-Wconf:cat=lint-multiarg-infix:wv",
"-Wconf:cat=other-nullary-override:wv",
"-Wconf:cat=other-match-analysis&site=org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction.catalogFunction:wv",
Expand Down