From eeb8bfac8271c8d2a13e3b25d3dd19844989e924 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Thu, 16 Jan 2020 15:04:18 -0800 Subject: [PATCH 1/4] [SPARK-30534][INFRA] Use mvn in `dev/scalastyle` --- dev/scalastyle | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/dev/scalastyle b/dev/scalastyle index 212ef900eb9b4..b555ce08b789e 100755 --- a/dev/scalastyle +++ b/dev/scalastyle @@ -17,18 +17,10 @@ # limitations under the License. # -SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -# NOTE: echo "q" is needed because SBT prompts the user for input on encountering a build file -# with failure (either resolution or compilation); the "q" makes SBT quit. -ERRORS=$(echo -e "q\n" \ - | build/sbt \ - ${SPARK_PROFILES} \ - -Pdocker-integration-tests \ - -Pkubernetes-integration-tests \ - scalastyle test:scalastyle \ - | awk '{if($1~/error/)print}' \ -) +SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive -Pdocker-integration-tests -Pkubernetes-integration-tests"} +ERRORS=$($SCRIPT_DIR/../build/mvn $SPARK_PROFILES scalastyle:check | grep "^error file") if test ! -z "$ERRORS"; then echo -e "Scalastyle checks failed at following occurrences:\n$ERRORS" From 1e468eadbfd9a9c929b7ad98aa39b459a9d5f76c Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Thu, 16 Jan 2020 15:21:38 -0800 Subject: [PATCH 2/4] Move test source into source --- pom.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e72fcd90a38d8..28d229955377c 100644 --- a/pom.xml +++ b/pom.xml @@ -2762,8 +2762,10 @@ true false false - ${basedir}/src/main/scala - ${basedir}/src/test/scala + ${basedir}/src/main/scala + ${basedir}/src/main/scala + ${basedir}/src/test/scala + scalastyle-config.xml ${basedir}/target/scalastyle-output.xml ${project.build.sourceEncoding} From 08e44003144a1b5f461a45380572a8e6eca55045 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Thu, 16 Jan 2020 15:34:35 -0800 Subject: [PATCH 3/4] use flag --- .../org/apache/spark/resource/ResourceProfileSuite.scala | 1 + pom.xml | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala index a087f18b3fc6d..e455b6cf331bd 100644 --- a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala +++ b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala @@ -18,6 +18,7 @@ package org.apache.spark.resource import org.apache.spark.{SparkConf, SparkFunSuite} + import org.apache.spark.internal.config._ class ResourceProfileSuite extends SparkFunSuite { diff --git a/pom.xml b/pom.xml index 28d229955377c..58c05357ef417 100644 --- a/pom.xml +++ b/pom.xml @@ -2760,12 +2760,10 @@ false true - false + true false - ${basedir}/src/main/scala - ${basedir}/src/main/scala - ${basedir}/src/test/scala - + ${basedir}/src/main/scala + ${basedir}/src/test/scala scalastyle-config.xml ${basedir}/target/scalastyle-output.xml ${project.build.sourceEncoding} From 9c8e204ccbd08127e457f5507b1eaf41b78e222b Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Thu, 16 Jan 2020 15:35:11 -0800 Subject: [PATCH 4/4] clean up --- .../scala/org/apache/spark/resource/ResourceProfileSuite.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala index e455b6cf331bd..a087f18b3fc6d 100644 --- a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala +++ b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala @@ -18,7 +18,6 @@ package org.apache.spark.resource import org.apache.spark.{SparkConf, SparkFunSuite} - import org.apache.spark.internal.config._ class ResourceProfileSuite extends SparkFunSuite {