aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorHolden Karau <holden@us.ibm.com>2016-03-25 12:53:34 +0000
committerSean Owen <sowen@cloudera.com>2016-03-25 12:53:34 +0000
commit55a605763dfcd544d0c8bdd6a148bdb0a7589fe9 (patch)
treefbc781cb7d573c88585f896bec381bfe4787aa1c /dev
parente9b6e7d8577cd721a433130f29e8b112d98768b9 (diff)
downloadspark-55a605763dfcd544d0c8bdd6a148bdb0a7589fe9.tar.gz
spark-55a605763dfcd544d0c8bdd6a148bdb0a7589fe9.tar.bz2
spark-55a605763dfcd544d0c8bdd6a148bdb0a7589fe9.zip
[SPARK-13887][PYTHON][TRIVIAL][BUILD] Make lint-python script fail fast
## What changes were proposed in this pull request? Change lint python script to stop on first error rather than building them up so its clearer why we failed (requested by rxin). Also while in the file, remove the commented out code. ## How was this patch tested? Manually ran lint-python script with & without pep8 errors locally and verified expected results. Author: Holden Karau <holden@us.ibm.com> Closes #11898 from holdenk/SPARK-13887-pylint-fast-fail.
Diffstat (limited to 'dev')
-rwxr-xr-xdev/lint-python43
1 files changed, 6 insertions, 37 deletions
diff --git a/dev/lint-python b/dev/lint-python
index 477ac0ef6d..63487043a5 100755
--- a/dev/lint-python
+++ b/dev/lint-python
@@ -60,22 +60,6 @@ export "PYTHONPATH=$SPARK_ROOT_DIR/dev/pylint"
export "PYLINT_HOME=$PYTHONPATH"
export "PATH=$PYTHONPATH:$PATH"
-# if [ ! -d "$PYLINT_HOME" ]; then
-# mkdir "$PYLINT_HOME"
-# # Redirect the annoying pylint installation output.
-# easy_install -d "$PYLINT_HOME" pylint==1.4.4 &>> "$PYLINT_INSTALL_INFO"
-# easy_install_status="$?"
-#
-# if [ "$easy_install_status" -ne 0 ]; then
-# echo "Unable to install pylint locally in \"$PYTHONPATH\"."
-# cat "$PYLINT_INSTALL_INFO"
-# exit "$easy_install_status"
-# fi
-#
-# rm "$PYLINT_INSTALL_INFO"
-#
-# fi
-
# There is no need to write this output to a file
#+ first, but we do so so that the check status can
#+ be output before the report, like with the
@@ -92,12 +76,13 @@ fi
if [ "$lint_status" -ne 0 ]; then
echo "PEP8 checks failed."
cat "$PEP8_REPORT_PATH"
+ rm "$PEP8_REPORT_PATH"
+ exit "$lint_status"
else
echo "PEP8 checks passed."
+ rm "$PEP8_REPORT_PATH"
fi
-rm "$PEP8_REPORT_PATH"
-
# Check that the documentation builds acceptably, skip check if sphinx is not installed.
if hash "$SPHINXBUILD" 2> /dev/null; then
cd python/docs
@@ -110,29 +95,13 @@ if hash "$SPHINXBUILD" 2> /dev/null; then
echo "re-running make html to print full warning list"
make clean
SPHINXOPTS="-a" make html
+ rm "$SPHINX_REPORT_PATH"
+ exit "$lint_status"
else
echo "pydoc checks passed."
+ rm "$SPHINX_REPORT_PATH"
fi
- rm "$SPHINX_REPORT_PATH"
cd ../..
else
echo >&2 "The $SPHINXBUILD command was not found. Skipping pydoc checks for now"
fi
-
-
-# for to_be_checked in "$PATHS_TO_CHECK"
-# do
-# pylint --rcfile="$SPARK_ROOT_DIR/python/pylintrc" $to_be_checked >> "$PYLINT_REPORT_PATH"
-# done
-
-# if [ "${PIPESTATUS[0]}" -ne 0 ]; then
-# lint_status=1
-# echo "Pylint checks failed."
-# cat "$PYLINT_REPORT_PATH"
-# else
-# echo "Pylint checks passed."
-# fi
-
-# rm "$PYLINT_REPORT_PATH"
-
-exit "$lint_status"