def run(self):
        """Primary entry point to the plugin, runs once per file."""
        paths = [x for x in practices.__dict__.values()
                 if hasattr(x, 'code')]

        for node in ast.walk(self.tree):
            try:
                lineno, col_offset = node.lineno, node.col_offset
            except AttributeError:
                # Not all nodes have coordinates, e.g.: ast.Module
                continue

            for checker in paths:
                if checker(node):
                    message = self.build_message(checker)
                    yield lineno, col_offset, message, type(self)
def run ( self ) : paths = [ x for x in practices . __dict__ . values ( ) if hasattr ( x , 'code' ) ] for node in ast . walk ( self . tree ) : try : lineno , col_offset = node . lineno , node . col_offset except AttributeError : continue for checker in paths : if checker ( node ) : message = self . build_message ( checker ) yield lineno , col_offset , message , type ( self )
Primary entry point to the plugin, runs once per file.