You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jo...@apache.org on 2015/12/07 02:36:40 UTC
spark git commit: [SPARK-12152][PROJECT-INFRA] Speed up Scalastyle
checks by only invoking SBT once
Repository: spark
Updated Branches:
refs/heads/master 49efd03ba -> 80a824d36
[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 <jo...@databricks.com>
Closes #10151 from JoshRosen/speed-up-scalastyle.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/80a824d3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/80a824d3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/80a824d3
Branch: refs/heads/master
Commit: 80a824d36eec9d9a9f092ee1741453851218ec73
Parents: 49efd03
Author: Josh Rosen <jo...@databricks.com>
Authored: Sun Dec 6 17:35:01 2015 -0800
Committer: Josh Rosen <jo...@databricks.com>
Committed: Sun Dec 6 17:35:01 2015 -0800
----------------------------------------------------------------------
dev/scalastyle | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/80a824d3/dev/scalastyle
----------------------------------------------------------------------
diff --git a/dev/scalastyle b/dev/scalastyle
index ad93f7e..8fd3604 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"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org