diff options
author | Hans de Goede <hdegoede@redhat.com> | 2008-10-29 16:24:28 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2008-10-29 16:52:32 +0100 |
commit | 54347f57a867d3abb7798ffde2da88fcbfb8971f (patch) | |
tree | 163668a3de4b50e8dd88042d698d2d74ff0036e9 /runpychecker.sh | |
parent | ae46ce141919abdfcd258989b2ce0e3e435eb85b (diff) | |
download | anaconda-54347f57a867d3abb7798ffde2da88fcbfb8971f.tar.gz anaconda-54347f57a867d3abb7798ffde2da88fcbfb8971f.tar.xz anaconda-54347f57a867d3abb7798ffde2da88fcbfb8971f.zip |
Add runpychecker.sh script and pychecker-false-positives file
The runpychecker.sh script will check anaconda for any pychecker warning using
a set of options, in combination with filtering of any warning regular-
expressions listed in pychecker-false-positives. If any warnings our found
they will be stored in pychecker-log and printed to stdout and runpychecker.sh
will exit with a status of 1, if no (non filtered) warnings are found it exits
with a status of 0
Diffstat (limited to 'runpychecker.sh')
-rwxr-xr-x | runpychecker.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/runpychecker.sh b/runpychecker.sh new file mode 100755 index 000000000..dacbacf37 --- /dev/null +++ b/runpychecker.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +FALSE_POSITIVES=pychecker-false-positives + +if [ "`tail -c 1 pychecker-false-positives`" == "`echo`" ]; then + echo "Error $FALSE_POSITIVES ends with an enter." + echo "Error the last line of $FALSE_POSITIVES should never have an enter!" + exit 1 +fi + +export PYTHONPATH="isys:textw:iw:installclasses:/usr/lib/booty" + +pychecker --only --limit 1000 \ + --maxlines 500 --maxargs 20 --maxbranches 80 --maxlocals 60 --maxreturns 20 \ + --no-callinit --no-local --no-shadow --no-shadowbuiltin \ + --no-import --no-miximport --no-pkgimport --no-reimport \ + --no-argsused --no-varargsused --no-override \ + anaconda anaconda *.py textw/*.py iw/*.py installclasses/*.py isys/*.py | \ + egrep -v "`cat $FALSE_POSITIVES | tr '\n' '|'`" > pychecker-log + +if [ -s pychecker-log ]; then + echo "Pychecker reports the following issues:" + cat pychecker-log + exit 1 +fi + +rm pychecker-log + +exit 0 |