Invoke pylint from build script.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Mon, 18 May 2009 20:23:42 +0200
changeset 2328 e077dc264dff
parent 2327 6c7d0fba105c
child 2329 4e487ffd4102
Invoke pylint from build script. Using --skip-pylint build script command line parameter you can skip pylint invocation.
scripts/build.sh
scripts/pylint/do_pylint.sh
--- a/scripts/build.sh	Mon May 18 19:37:38 2009 +0200
+++ b/scripts/build.sh	Mon May 18 20:23:42 2009 +0200
@@ -20,6 +20,17 @@
 APP_DIRS=${APP_DIRS:-"${DEFAULT_APP_DIRS}"}
 ZIP_FILES=${ZIP_FILES:-"${DEFAULT_ZIP_FILES}"}
 
+
+if [ "$1" != "--skip-pylint" ]; then
+  cd pylint
+  bash do_pylint.sh --silent
+  if [ "$?" != "1" ] ; then
+      echo ' Build failed. Build script encountered pylint errors.'
+      exit 1
+  fi
+  cd ..
+fi
+
 if [ -e $APP_FOLDER ] ; then
     cd $APP_FOLDER
 else
--- a/scripts/pylint/do_pylint.sh	Mon May 18 19:37:38 2009 +0200
+++ b/scripts/pylint/do_pylint.sh	Mon May 18 20:23:42 2009 +0200
@@ -36,7 +36,6 @@
 PROJ_DIR=$(cd "$PROJ_DIR"; pwd)
 APP_DIR="${PROJ_DIR}/app"
 
-# Note: We will add ghop and gsoc modules once there something in there
 CHECK_MODULES="soc reflistprop settings.py urls.py main.py"
 
 PYLINTRC=$(dirname "$0")/pylintrc
@@ -60,3 +59,4 @@
 done
 
 pylint $SILENT_ARGS $ARGS $CHECK_MODULES_PATHS
+exit $?
\ No newline at end of file