Repository: spark
Updated Branches:
  refs/heads/master e9b6e7d85 -> 55a605763


[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 <hol...@us.ibm.com>

Closes #11898 from holdenk/SPARK-13887-pylint-fast-fail.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/55a60576
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/55a60576
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/55a60576

Branch: refs/heads/master
Commit: 55a605763dfcd544d0c8bdd6a148bdb0a7589fe9
Parents: e9b6e7d
Author: Holden Karau <hol...@us.ibm.com>
Authored: Fri Mar 25 12:53:34 2016 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Fri Mar 25 12:53:34 2016 +0000

----------------------------------------------------------------------
 dev/lint-python | 43 ++++++-------------------------------------
 1 file changed, 6 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/55a60576/dev/lint-python
----------------------------------------------------------------------
diff --git a/dev/lint-python b/dev/lint-python
index 477ac0e..6348704 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"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to