From: Neal N. <nno...@us...> - 2007-04-23 06:41:36
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18081/pychecker Modified Files: CodeChecks.py Config.py Log Message: SF patch # 1665773, Add --missingattrs option to ignore some (but not all) attribute names courtesy of mostlybrain. Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** CodeChecks.py 2 Nov 2006 04:37:20 -0000 1.168 --- CodeChecks.py 23 Apr 2007 06:41:36 -0000 1.169 *************** *** 420,424 **** pass elif cfg().classAttrExists : ! code.addWarning(msgs.INVALID_CLASS_ATTR % attr) def _checkModuleAttribute(attr, module, code, ref) : --- 420,425 ---- pass elif cfg().classAttrExists : ! if attr not in cfg().missingAttrs: ! code.addWarning(msgs.INVALID_CLASS_ATTR % attr) def _checkModuleAttribute(attr, module, code, ref) : Index: Config.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/Config.py,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Config.py 20 Sep 2006 06:52:11 -0000 1.109 --- Config.py 23 Apr 2007 06:41:36 -0000 1.110 *************** *** 43,46 **** --- 43,47 ---- ] _DEFAULT_UNUSED_LIST = [ '_', 'empty', 'unused', 'dummy', ] + _DEFAULT_MISSING_ATTRS_LIST = [] _OPTIONS = ( *************** *** 117,120 **** --- 118,122 ---- ('Z', 1, 'varlist', 'variablesToIgnore', 'ignore global variables not used if name is one of these values\n\t\t\t'), ('E', 1, 'unusednames', 'unusedNames', 'ignore unused locals/arguments if name is one of these values\n\t\t\t'), + ('', 1, 'missingattrs', 'missingAttrs', 'ignore missing class attributes if name is one of these values\n\t\t\t'), ( '', 0, 'deprecated', 'deprecated', 'ignore use of deprecated modules/functions'), ]), *************** *** 276,279 **** --- 278,282 ---- self.variablesToIgnore = _DEFAULT_VARIABLE_IGNORE_LIST self.blacklist = _DEFAULT_BLACK_LIST + self.missingAttrs = _DEFAULT_MISSING_ATTRS_LIST self.ignoreStandardLibrary = 0 self.methodArgName = 'self' |