summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-09-19 17:27:40 +0000
committerChris Lumens <clumens@redhat.com>2007-09-19 17:27:40 +0000
commit99ca8fc7e66eefe1d457aeedc9375506057bc678 (patch)
tree24a84ad8c2b9ece07758dbcf25e3d14017596030
parent481c96f7025eaa99eec896b88e5892544afd5245 (diff)
downloadanaconda-99ca8fc7e66eefe1d457aeedc9375506057bc678.tar.gz
anaconda-99ca8fc7e66eefe1d457aeedc9375506057bc678.tar.xz
anaconda-99ca8fc7e66eefe1d457aeedc9375506057bc678.zip
Update pychecker configuration to be more useful.
-rw-r--r--ChangeLog5
-rw-r--r--Makefile7
-rw-r--r--pycheckrc-for-anaconda232
3 files changed, 206 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bef714e3..80a33c6dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-19 Chris Lumens <clumens@redhat.com>
+
+ * Makefile: Make the pycheck and pycheckfile targets more useful.
+ * pycheckrc-for-anaconda: Update for more useful default settings.
+
2007-09-19 Jeremy Katz <katzj@redhat.com>
* livecd.py (LiveCDImageMethod.unmountNonFstabDirs): Fix syntax error.
diff --git a/Makefile b/Makefile
index d6a63ce27..9a8d0e101 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,9 @@ SUBDIRS += liveinst
SUBDIRS += gptsync
endif
+PYCHECKERPATH=isys:textw:iw:installclasses:/usr/lib/booty:/usr/share/system-config-date
+PYCHECKEROPTS=-F pycheckrc-for-anaconda
+
CATALOGS = po/anaconda.pot
PYFILES = $(wildcard *.py)
@@ -121,10 +124,10 @@ create-archive:
make create-snapshot
pycheck:
- PYTHONPATH=isys:textw:iw:installclasses:booty:booty/edd pychecker *.py textw/*.py iw/*.py installclasses/*.py command-stubs/*-stub | grep -v "__init__() not called"
+ PYTHONPATH=$(PYCHECKERPATH) pychecker $(PYCHECKEROPTS) *.py textw/*.py iw/*.py installclasses/*.py | grep -v "__init__() not called"
pycheck-file:
- PYTHONPATH=.:isys:textw:iw:installclasses:booty:booty/edd pychecker $(CHECK) | grep -v "__init__() not called"
+ PYTHONPATH=.:$(PYCHECKERPATH) pychecker $(PYCHECKEROPTS) $(CHECK) | grep -v "__init__() not called"
PKGNAME=anaconda
local: clean
diff --git a/pycheckrc-for-anaconda b/pycheckrc-for-anaconda
index 11b44ae3a..cab70ce97 100644
--- a/pycheckrc-for-anaconda
+++ b/pycheckrc-for-anaconda
@@ -1,63 +1,223 @@
-# Sample defaults file for PyChecker 0.3.x
-# This file should be called: .pycheckrc
+#
+# .pycheckrc file created by PyChecker v0.8.17 @ Wed Sep 19 12:18:52 2007
+#
# It should be placed in your home directory (value of $HOME).
# If $HOME is not set, it will look in the current directory.
+#
-# bool: warnings for Doc Strings
-noDocModule = 0
-noDocClass = 0
-noDocFunc = 0
+# only warn about files passed on the command line
+only = 1
-# bool: when checking if class data members (attributes) are set
-# check all members or __init__() only
-onlyCheckInitForMembers = 0
+# the maximum number of warnings to be displayed
+limit = 0
-# bool: warn when all module variables are not used (including private vars)
-allVariablesUsed = 0
+# list of evil C extensions that crash the interpreter
+evil = []
-# bool: produce warnings for each occurrence of a warning for global (xxx)
-reportAllGlobals = 0
+# unused imports
+importUsed = 1
-# bool: warn when private module variables are not used (_var)
-privateVariableUsed = 1
+# unused imports from __init__.py
+packageImportUsed = 1
-# bool: warn when imports are not used
-importUsed = 1
+# module imports itself
+reimportSelf = 1
-# bool: warn when local variables are not used
+# reimporting a module
+moduleImportErrors = 1
+
+# module does import and from ... import
+mixImport = 1
+
+# unused local variables, except tuples
localVariablesUsed = 1
-# bool: assume a, b, and c are used in this case: a, b, c = func()
+# all unused local variables, including tuples
unusedLocalTuple = 0
-# bool: warn when __init__ is defined in a subclass
-initDefinedInSubclass = 0
+# all unused class data members
+membersUsed = 0
-# bool: warn when calling an attribute not a method
-callingAttribute = 1
+# all unused module variables
+allVariablesUsed = 0
-# bool: warn when using named arguments: func(a=1, b=2), where def func(a, b):
-# def func2(a, b, **kw): doesn't generate a warning
+# unused private module variables
+privateVariableUsed = 1
+
+# report each occurrence of global warnings
+reportAllGlobals = 0
+
+# functions called with named arguments (like keywords)
namedArgs = 0
-# int: warnings for code complexity, max value before generating a warning
-maxLines = 200
-maxBranches = 50
+# Attributes (members) must be defined in __init__()
+onlyCheckInitForMembers = 0
+
+# Subclass.__init__() not defined
+initDefinedInSubclass = 0
+
+# Baseclass.__init__() not called
+baseClassInitted = 1
+
+# Subclass needs to override methods that only throw exceptions
+abstractClasses = 1
+
+# Return None from __init__()
+returnNoneFromInit = 1
+
+# unreachable code
+unreachableCode = 0
+
+# a constant is used in a conditional statement
+constantConditions = 1
+
+# 1 is used in a conditional statement (if 1: or while 1:)
+constant1 = 0
+
+# check if iterating over a string
+stringIteration = 1
+
+# check improper use of string.find()
+stringFind = 1
+
+# Calling data members as functions
+callingAttribute = 0
+
+# class attribute does not exist
+classAttrExists = 1
+
+# First argument to methods
+methodArgName = 'self'
+
+# First argument to classmethods
+classmethodArgNames = ['cls', 'klass']
+
+# unused method/function arguments
+argumentsUsed = 0
+
+# unused method/function variable arguments
+varArgumentsUsed = 1
+
+# ignore if self is unused in methods
+ignoreSelfUnused = 0
+
+# check if overridden methods have the same signature
+checkOverridenMethods = 1
+
+# check if __special__ methods exist and have the correct signature
+checkSpecialMethods = 1
+
+# check if function/class/method names are reused
+redefiningFunction = 1
+
+# check if using unary positive (+) which is usually meaningless
+unaryPositive = 1
+
+# check if modify (call method) on a parameter that has a default value
+modifyDefaultValue = 1
+
+# check if variables are set to different types
+inconsistentTypes = 0
+
+# check if unpacking a non-sequence
+unpackNonSequence = 1
+
+# check if unpacking sequence with the wrong length
+unpackLength = 1
+
+# check if raising or catching bad exceptions
+badExceptions = 1
+
+# check if statement appears to have no effect
+noEffect = 1
+
+# check if using (expr % 1), it has no effect on integers and strings
+modulo1 = 1
+
+# check if using (expr is const-literal), doesn't always work on integers and strings
+isLiteral = 1
+
+# check consistent return values
+checkReturnValues = 1
+
+# check if using implict and explicit return values
+checkImplicitReturns = 1
+
+# check that attributes of objects exist
+checkObjectAttrs = 1
+
+# various warnings about incorrect usage of __slots__
+slots = 1
+
+# using properties with classic classes
+classicProperties = 1
+
+# check if __slots__ is empty
+emptySlots = 1
+
+# check if using integer division
+intDivide = 1
+
+# check if local variable shadows a global
+shadows = 1
+
+# check if a variable shadows a builtin
+shadowBuiltins = 0
+
+# check if input() is used
+usesInput = 1
+
+# check if the exec statement is used
+usesExec = 0
+
+# ignore warnings from files under standard library
+ignoreStandardLibrary = 0
+
+# ignore warnings from the list of modules
+blacklist = ['Tkinter', 'wxPython', 'gtk', 'GTK', 'GDK']
+
+# ignore global variables not used if name is one of these values
+variablesToIgnore = ['__version__', '__warningregistry__', '__all__', '__credits__', '__test__', '__author__', '__email__', '__revision__', '__id__', '__copyright__', '__license__', '__date__']
+
+# ignore unused locals/arguments if name is one of these values
+unusedNames = ['_', 'empty', 'unused', 'dummy']
+
+# ignore use of deprecated modules/functions
+deprecated = 1
+
+# maximum lines in a function
+maxLines = 0
+
+# maximum branches in a function
+maxBranches = 0
+
+# maximum returns in a function
maxReturns = 10
-# list of strings: ignore warnings generated from these modules
-blacklist = [ 'Tkinter', 'wxPython', 'gtk', 'GTK', 'GDK', ]
+# maximum # of arguments to a function
+maxArgs = 0
+# maximum # of locals in a function
+maxLocals = 40
-# list of strings: ignore variable not used warnings from the list
-variablesToIgnore = [ '__all__', '__version__', '__copyright__', ]
+# maximum # of identifier references (Law of Demeter)
+maxReferences = 5
+
+# no module doc strings
+noDocModule = 0
+
+# no class doc strings
+noDocClass = 0
+
+# no function/method doc strings
+noDocFunc = 0
-# bool: print the PyChecker parse of modules, classes, etc.
+# print internal checker parse structures
printParse = 0
-# bool: turn debugging of PyChecker on
+# turn on debugging for checker
debug = 0
-# EXPERIMENTAL bool: check consistent return values
-checkReturnValues = 0
+# turn off all output except warnings
+quiet = 0