|
|
cded5fc |
diff -rupN virt-manager-0.6.1/tests/Makefile.am new/tests/Makefile.am
|
|
|
cded5fc |
--- virt-manager-0.6.1/tests/Makefile.am 1969-12-31 19:00:00.000000000 -0500
|
|
|
cded5fc |
+++ new/tests/Makefile.am 2009-03-18 13:05:51.516847000 -0400
|
|
|
cded5fc |
@@ -0,0 +1,4 @@
|
|
|
cded5fc |
+testsdir = $(pkgdatadir)/tests
|
|
|
cded5fc |
+tests_DATA = $(wildcard $(srcdir)/*.sh)
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+EXTRA_DIST = $(tests_DATA)
|
|
|
cded5fc |
diff -rupN virt-manager-0.6.1/tests/pylint-virt-manager.sh new/tests/pylint-virt-manager.sh
|
|
|
cded5fc |
--- virt-manager-0.6.1/tests/pylint-virt-manager.sh 1969-12-31 19:00:00.000000000 -0500
|
|
|
cded5fc |
+++ new/tests/pylint-virt-manager.sh 2009-03-18 13:05:51.513848000 -0400
|
|
|
cded5fc |
@@ -0,0 +1,115 @@
|
|
|
cded5fc |
+#!/bin/sh
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# pylint doesn't work well with a file named xxx.py.xxx
|
|
|
cded5fc |
+cp src/virt-manager.py.in src/_virt-manager
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+cd src || exit 1
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+IGNOREFILES="IPy.py"
|
|
|
cded5fc |
+FILES="virtManager/ _virt-manager"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# Deliberately ignored warnings:
|
|
|
cded5fc |
+# Don't print pylint config warning
|
|
|
cded5fc |
+NO_PYL_CONFIG=".*No config file found.*"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# The gettext function is installed in the builtin namespace
|
|
|
cded5fc |
+GETTEXT_VAR="Undefined variable '_'"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# These all work fine and are legit, just false positives
|
|
|
cded5fc |
+GOBJECT_VAR="has no '__gobject_init__' member"
|
|
|
cded5fc |
+EMIT_VAR="has no 'emit' member"
|
|
|
cded5fc |
+ERROR_VBOX="vmmErrorDialog.__init__.*Class 'vbox' has no 'pack_start' member"
|
|
|
cded5fc |
+EXCEPTHOOK="no '__excepthook__' member"
|
|
|
cded5fc |
+CONNECT_VAR="no 'connect' member"
|
|
|
cded5fc |
+DISCONNECT_VAR="no 'disconnect' member"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# os._exit is needed for forked processes.
|
|
|
cded5fc |
+OS_EXIT="protected member _exit of a client class"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# Avahi API may have requirements on callback argument names, so ignore these
|
|
|
cded5fc |
+# warnings
|
|
|
cded5fc |
+BTYPE_LIST="(vmmConnect.add_service|vmmConnect.remove_service|vmmConnect.add_conn_to_list)"
|
|
|
cded5fc |
+BUILTIN_TYPE="${BTYPE_LIST}.*Redefining built-in 'type'"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+DMSG=""
|
|
|
cded5fc |
+addmsg() {
|
|
|
cded5fc |
+ DMSG="${DMSG},$1"
|
|
|
cded5fc |
+}
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+addchecker() {
|
|
|
cded5fc |
+ DCHECKERS="${DCHECKERS},$1"
|
|
|
cded5fc |
+}
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# Disabled unwanted messages
|
|
|
cded5fc |
+addmsg "C0103" # C0103: Name doesn't match some style regex
|
|
|
cded5fc |
+addmsg "C0111" # C0111: No docstring
|
|
|
cded5fc |
+addmsg "C0301" # C0301: Line too long
|
|
|
cded5fc |
+addmsg "C0302" # C0302: Too many lines in module
|
|
|
cded5fc |
+addmsg "C0324" # C0324: *Comma not followed by a space*
|
|
|
cded5fc |
+addmsg "R0201" # R0201: Method could be a function
|
|
|
cded5fc |
+addmsg "W0105" # W0105: String statement has no effect
|
|
|
cded5fc |
+addmsg "W0141" # W0141: Complaining about 'map' and 'filter'
|
|
|
cded5fc |
+addmsg "W0142" # W0142: *Used * or ** magic*
|
|
|
cded5fc |
+addmsg "W0403" # W0403: Relative imports
|
|
|
cded5fc |
+addmsg "W0603" # W0603: Using the global statement
|
|
|
cded5fc |
+addmsg "W0702" # W0703: No exception type specified
|
|
|
cded5fc |
+addmsg "W0703" # W0703: Catch 'Exception'
|
|
|
cded5fc |
+addmsg "W0704" # W0704: Exception doesn't do anything
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# Potentially useful messages, disabled for now
|
|
|
cded5fc |
+addmsg "C0322" # C0322: *Operator not preceded by a space*
|
|
|
cded5fc |
+addmsg "C0323" # C0323: *Operator not followed by a space*
|
|
|
cded5fc |
+addmsg "W0201" # W0201: Defined outside __init__
|
|
|
cded5fc |
+addmsg "W0511" # W0511: FIXME and XXX: messages
|
|
|
cded5fc |
+addmsg "W0613" # W0613: Unused arguments
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# Disabled Checkers:
|
|
|
cded5fc |
+addchecker "Design" # Things like "Too many func arguments",
|
|
|
cded5fc |
+ # "Too man public methods"
|
|
|
cded5fc |
+addchecker "Similarities" # Finds duplicate code (enable this later?)
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+# May want to enable this in the future
|
|
|
cded5fc |
+SHOW_REPORT="n"
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+AWK=awk
|
|
|
cded5fc |
+[ `uname -s` = 'SunOS' ] && AWK=nawk
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+pylint --ignore=IPy.py $FILES \
|
|
|
cded5fc |
+ --reports=$SHOW_REPORT \
|
|
|
cded5fc |
+ --output-format=colorized \
|
|
|
cded5fc |
+ --dummy-variables-rgx="dummy|ignore*" \
|
|
|
cded5fc |
+ --disable-msg=${DMSG}\
|
|
|
cded5fc |
+ --disable-checker=${DCHECKERS} 2>&1 | \
|
|
|
cded5fc |
+ egrep -ve "$NO_PYL_CONFIG" \
|
|
|
cded5fc |
+ -ve "$GOBJECT_VAR" \
|
|
|
cded5fc |
+ -ve "$EMIT_VAR" \
|
|
|
cded5fc |
+ -ve "$CONNECT_VAR" \
|
|
|
cded5fc |
+ -ve "$DISCONNECT_VAR" \
|
|
|
cded5fc |
+ -ve "$GETTEXT_VAR" \
|
|
|
cded5fc |
+ -ve "$OS_EXIT" \
|
|
|
cded5fc |
+ -ve "$BUILTIN_TYPE" \
|
|
|
cded5fc |
+ -ve "$ERROR_VBOX" \
|
|
|
cded5fc |
+ -ve "$EXCEPTHOOK" | \
|
|
|
cded5fc |
+$AWK '\
|
|
|
cded5fc |
+# Strip out any "*** Module name" lines if we dont list any errors for them
|
|
|
cded5fc |
+BEGIN { found=0; cur_line="" }
|
|
|
cded5fc |
+{
|
|
|
cded5fc |
+ if (found == 1) {
|
|
|
cded5fc |
+ if ( /\*\*\*/ ) {
|
|
|
cded5fc |
+ prev_line = $0
|
|
|
cded5fc |
+ } else {
|
|
|
cded5fc |
+ print prev_line
|
|
|
cded5fc |
+ print $0
|
|
|
cded5fc |
+ found = 0
|
|
|
cded5fc |
+ }
|
|
|
cded5fc |
+ } else if ( /\*\*\*/ ) {
|
|
|
cded5fc |
+ found = 1
|
|
|
cded5fc |
+ prev_line = $0
|
|
|
cded5fc |
+ } else {
|
|
|
cded5fc |
+ print $0
|
|
|
cded5fc |
+ }
|
|
|
cded5fc |
+}'
|
|
|
cded5fc |
+
|
|
|
cded5fc |
+cd - > /dev/null
|
|
|
cded5fc |
+rm src/_virt-manager
|
|
|
cded5fc |
diff -rup virt-manager-0.6.1/Makefile.am new/Makefile.am
|
|
|
cded5fc |
--- virt-manager-0.6.1/Makefile.am 2009-01-26 14:33:33.000000000 -0500
|
|
|
cded5fc |
+++ new/Makefile.am 2009-03-18 13:25:07.912999000 -0400
|
|
|
cded5fc |
@@ -11,4 +11,4 @@ rpm: clean
|
|
|
cded5fc |
$(MAKE) dist && rpmbuild -ta $(distdir).tar.gz
|
|
|
cded5fc |
|
|
|
cded5fc |
check-pylint:
|
|
|
cded5fc |
- tests/pylint-virt-manager.sh
|
|
|
cded5fc |
+ sh tests/pylint-virt-manager.sh
|