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