aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
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"