summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pychecker-false-positives25
-rwxr-xr-xrunpychecker.sh29
2 files changed, 54 insertions, 0 deletions
diff --git a/pychecker-false-positives b/pychecker-false-positives
new file mode 100644
index 000000000..d7567669c
--- /dev/null
+++ b/pychecker-false-positives
@@ -0,0 +1,25 @@
+deleted
+filter
+setattr
+^$
+^dm.c: [0-9]*: not running as root returning empty list$
+^Warnings...$
+^anaconda\.py:[0-9]*: No global .* found$
+^cmdline\.py:[0-9]*: No global \(nextWin\) found$
+^fsset\.py:[0-9]*: Object \(bestprep\) has no attribute \(format\)$
+^partitions.py:[0-9]*: Object \(bestprep\) has no attribute \(getPreExisting\)$
+^partitions.py:[0-9]*: Object \(bestreq\) has no attribute \(format\)$
+^iscsi.py:[0-9]*: Invalid arguments to \(addTarget\), got 0, expected between 1 and 7$
+^minihal.py:[0-9]*: Object \(haldev\) has no attribute \(GetAllProperties\)$
+^minihal.py:[0-9]*: Object \(hal\) has no attribute \(FindDeviceByCapability\)$
+^(.*isys/isys.py|network.py):[0-9]*: Object \(.*_iface\) has no attribute \(Get.*\)$
+^network.py:[0-9]*: Object \(.*props\) has no attribute \(Get\)$
+^partedUtils.py:[0-9]*: No module attribute \(__dict__\) found$
+^partedUtils.py:[0-9]*: No module attribute \(DEVICE_SX8\) found$
+^kickstart.py:[0-9]*: No global \(fileSystemTypeGet.*\) found$
+^upgrade.py:[0-9]*: No global \(getUsableLinuxFs\) found$
+^upgrade.py:[0-9]*: No global \(SwapFileDevice\) found$
+^upgrade.py:[0-9]*: No global \(fileSystemTypeGet\) found$
+^upgrade.py:[0-9]*: No global \(FileSystemSetEntry\) found$
+^upgrade.py:[0-9]*: No global \(readFstab\) found$
+Note this last line must never end with a newline \ No newline at end of file
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