aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2015-12-06 17:35:01 -0800
committerJosh Rosen <joshrosen@databricks.com>2015-12-06 17:35:01 -0800
commit80a824d36eec9d9a9f092ee1741453851218ec73 (patch)
treef02299244ad6492191beb25be03ca842308f80aa /dev
parent49efd03bacad6060d99ed5e2fe53ba3df1d1317e (diff)
downloadspark-80a824d36eec9d9a9f092ee1741453851218ec73.tar.gz
spark-80a824d36eec9d9a9f092ee1741453851218ec73.tar.bz2
spark-80a824d36eec9d9a9f092ee1741453851218ec73.zip
[SPARK-12152][PROJECT-INFRA] Speed up Scalastyle checks by only invoking SBT once
Currently, `dev/scalastyle` invokes SBT four times, but these invocations can be replaced with a single invocation, saving about one minute of build time. Author: Josh Rosen <joshrosen@databricks.com> Closes #10151 from JoshRosen/speed-up-scalastyle.
Diffstat (limited to 'dev')
-rwxr-xr-xdev/scalastyle19
1 files changed, 11 insertions, 8 deletions
diff --git a/dev/scalastyle b/dev/scalastyle
index ad93f7e85b..8fd3604b9f 100755
--- a/dev/scalastyle
+++ b/dev/scalastyle
@@ -17,14 +17,17 @@
# limitations under the License.
#
-echo -e "q\n" | build/sbt -Pkinesis-asl -Phive -Phive-thriftserver scalastyle > scalastyle.txt
-echo -e "q\n" | build/sbt -Pkinesis-asl -Phive -Phive-thriftserver test:scalastyle >> scalastyle.txt
-# Check style with YARN built too
-echo -e "q\n" | build/sbt -Pkinesis-asl -Pyarn -Phadoop-2.2 scalastyle >> scalastyle.txt
-echo -e "q\n" | build/sbt -Pkinesis-asl -Pyarn -Phadoop-2.2 test:scalastyle >> scalastyle.txt
-
-ERRORS=$(cat scalastyle.txt | awk '{if($1~/error/)print}')
-rm scalastyle.txt
+# 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 \
+ -Pkinesis-asl \
+ -Pyarn \
+ -Phive \
+ -Phive-thriftserver \
+ scalastyle test:scalastyle \
+ | awk '{if($1~/error/)print}' \
+)
if test ! -z "$ERRORS"; then
echo -e "Scalastyle checks failed at following occurrences:\n$ERRORS"