summaryrefslogtreecommitdiffstats
path: root/pylint-build-scan.sh
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-01-30 15:49:27 -0500
committerEndi S. Dewata <edewata@redhat.com>2015-02-05 11:32:20 -0500
commitdfe55982eb50750fc1e65bce312d884b1604f0b4 (patch)
tree411d1316c3b4ff78e3a349bb4923bd0e2aae03c7 /pylint-build-scan.sh
parent8fc5acb72ac9fdbc70b8a6e7242890f9dbeccf56 (diff)
downloadpki-dfe55982eb50750fc1e65bce312d884b1604f0b4.tar.gz
pki-dfe55982eb50750fc1e65bce312d884b1604f0b4.tar.xz
pki-dfe55982eb50750fc1e65bce312d884b1604f0b4.zip
Fixed pylint report.
Previously pylint report was saved it into a file which may not be accessible on a build system. The pylint-build-scan.sh has been changed to display the report so it will appear in the build log. The pylint configuration has also been modified to disable C and R messages by default. This way when other errors or warnings occur the build will fail without having to check for specific codes. Some Python codes have been modified to reduce the number of pylint warnings. https://fedorahosted.org/pki/ticket/703
Diffstat (limited to 'pylint-build-scan.sh')
-rwxr-xr-xpylint-build-scan.sh35
1 files changed, 4 insertions, 31 deletions
diff --git a/pylint-build-scan.sh b/pylint-build-scan.sh
index a4bff6bfc..cbaf972f0 100755
--- a/pylint-build-scan.sh
+++ b/pylint-build-scan.sh
@@ -15,43 +15,16 @@ PYLINT_RC_FILE_PATH="`cd $2/.. ; pwd`/dogtag.pylintrc"
PYTHON_PACKAGE_DIR="$HOME_DIR`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`"
-PYLINT_REPORT_PATH="`cd $HOME_DIR/../.. ; pwd`/pylint-report"
-
cd $PYTHON_PACKAGE_DIR
FILES="pki/"
+FILES="$FILES $HOME_DIR/usr/bin/pki"
FILES="$FILES $HOME_DIR/usr/sbin/pkispawn"
FILES="$FILES $HOME_DIR/usr/sbin/pkidestroy"
FILES="$FILES $HOME_DIR/usr/sbin/pki-upgrade"
FILES="$FILES $HOME_DIR/usr/sbin/pki-server"
FILES="$FILES $HOME_DIR/usr/sbin/pki-server-upgrade"
-rv=`pylint --rcfile=$PYLINT_RC_FILE_PATH $FILES >> $PYLINT_REPORT_PATH`
-
-status=$?
-
-#Excerpt from pylint man page
-#OUTPUT STATUS CODE
-# Pylint should leave with following status code:
-# * 0 if everything went fine
-# * 1 if a fatal message was issued
-# * 2 if an error message was issued
-# * 4 if a warning message was issued
-# * 8 if a refactor message was issued
-# * 16 if a convention message was issued
-# * 32 on usage error
-#
-# status 1 to 16 will be bit-ORed so you can know which different categories has been issued by analysing pylint output status code
-
-result=0
-if [ $(($status&1)) -eq 1 ] || [ $(($status&2)) -eq 2 ] || [ $(($status&4)) -eq 4 ]
-then
- echo -e "\n===============================================================================\n"
- echo -e " Pylint has reported errors or warnings in the python code.\n"
- echo -e " The report generated can be viewed at $PYLINT_REPORT_PATH.\n"
- echo -e " If the issues shown are false positives, re-build pki-core after marking them"
- echo -e " ignored in the configuration file dogtag.pylintrc, in the source code. \n"
- echo -e "===============================================================================\n"
- result=1
-fi
-exit $result
+pylint --rcfile=$PYLINT_RC_FILE_PATH $FILES
+
+exit $?