From e170422f74650b71c1eba408ac62020c31755e2b Mon Sep 17 00:00:00 2001 From: HyukjinKwon Date: Tue, 21 Jan 2020 18:23:03 +0900 Subject: [PATCH] Revert "[SPARK-30534][INFRA] Use mvn in `dev/scalastyle`" This reverts commit 384899944b25cb0abf5e71f9cc2610fecad4e8f5. --- dev/scalastyle | 14 +++++++++++--- pom.xml | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dev/scalastyle b/dev/scalastyle index b555ce08b7..212ef900eb 100755 --- a/dev/scalastyle +++ b/dev/scalastyle @@ -17,10 +17,18 @@ # limitations under the License. # -SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" +SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} -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") +# 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}' \ +) if test ! -z "$ERRORS"; then echo -e "Scalastyle checks failed at following occurrences:\n$ERRORS" diff --git a/pom.xml b/pom.xml index ef8fb709bb..d2b2b02050 100644 --- a/pom.xml +++ b/pom.xml @@ -2776,7 +2776,7 @@ false true - true + false false ${basedir}/src/main/scala ${basedir}/src/test/scala