[Pydev-cvs] org.python.pydev/PySrc/ThirdParty/logilab/pylint/checkers misc.py,1.4,1.5 exceptions.py,
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-02-24 18:29:15
|
Update of /cvsroot/pydev/org.python.pydev/PySrc/ThirdParty/logilab/pylint/checkers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8113/PySrc/ThirdParty/logilab/pylint/checkers Modified Files: misc.py exceptions.py utils.py __init__.py format.py raw_metrics.py classes.py base.py similar.py imports.py design_analysis.py variables.py Log Message: New pylint version integrated Index: format.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/PySrc/ThirdParty/logilab/pylint/checkers/format.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** format.py 16 Feb 2005 16:45:47 -0000 1.4 --- format.py 24 Feb 2005 18:28:48 -0000 1.5 *************** *** 276,282 **** #print 'checking line', self._lines[line] #print node ! msg_def = check_line(self._lines[line], self) ! if msg_def: ! self.add_message(msg_def[0], node = node, args=msg_def[1]) def check_lines(self, lines, start): --- 276,286 ---- #print 'checking line', self._lines[line] #print node ! try: ! msg_def = check_line(self._lines[line], self) ! if msg_def: ! self.add_message(msg_def[0], node = node, args=msg_def[1]) ! except KeyError: ! # FIXME: internal error ! ! pass def check_lines(self, lines, start): Index: variables.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/PySrc/ThirdParty/logilab/pylint/checkers/variables.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** variables.py 16 Feb 2005 16:45:47 -0000 1.4 --- variables.py 24 Feb 2005 18:28:48 -0000 1.5 *************** *** 25,30 **** from logilab.pylint.interfaces import IASTNGChecker from logilab.pylint.checkers import BaseChecker ! from logilab.pylint.checkers.utils import is_interface, is_abstract, \ ! is_builtin, is_native_builtin, is_error, are_exclusive --- 25,30 ---- from logilab.pylint.interfaces import IASTNGChecker from logilab.pylint.checkers import BaseChecker ! from logilab.pylint.checkers.utils import is_interface, is_error, is_builtin, \ ! is_native_builtin, is_abstract, are_exclusive, get_nodes_from_class *************** *** 195,208 **** # start from the parent frame of the function instead of the function # frame ! if is_func_default(node): start_index = len(self._to_consume) - 2 else: start_index = len(self._to_consume) - 1 # iterates through the parent scope, from the inner to the outer for i in range(start_index, -1, -1): to_consume, consumed, scope_type = self._to_consume[i] - # the name has already been consumed, ends - if consumed.has_key(name): - break # if the current scope is a class scope but it's not the inner scope # ignore it --- 195,206 ---- # start from the parent frame of the function instead of the function # frame ! if is_func_default(node) or is_ancestor_name(frame, node): start_index = len(self._to_consume) - 2 else: start_index = len(self._to_consume) - 1 # iterates through the parent scope, from the inner to the outer + frame_type = isinstance(frame, astng.Class) and 'class' or 'other' for i in range(start_index, -1, -1): to_consume, consumed, scope_type = self._to_consume[i] # if the current scope is a class scope but it's not the inner scope # ignore it *************** *** 212,215 **** --- 210,216 ---- if scope_type == 'class' and i != start_index: continue + # the name has already been consumed, ends + if consumed.has_key(name): + break # mark the name as consumed if it's defined in this scope # (ie no KeyError is raise by "to_consume[name]" *************** *** 245,249 **** return is_func_default(parent) ! def register(linter): """required method to auto register this checker""" --- 246,262 ---- return is_func_default(parent) ! def is_ancestor_name(frame, node): ! """return True if `frame` is a astng.Class node with `node` in the ! subtree of its bases attribute ! """ ! try: ! bases = frame.bases ! except AttributeError: ! return False ! for base in bases: ! if node in get_nodes_from_class(base, astng.Name): ! return True ! return False ! def register(linter): """required method to auto register this checker""" Index: exceptions.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/PySrc/ThirdParty/logilab/pylint/checkers/exceptions.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** exceptions.py 16 Feb 2005 16:45:47 -0000 1.4 --- exceptions.py 24 Feb 2005 18:28:48 -0000 1.5 *************** *** 97,101 **** else: lineno = value.source_line() - print value self.add_message('W0706', node=node, args=( node.expr1.as_string(), value.as_string(), --- 97,100 ---- |