pylint/lint.py
def check_astroid_module(self, ast_node, walker, rawcheckers, tokencheckers):
        """Check a module from its astroid representation."""
        try:
            tokens = utils.tokenize_module(ast_node)
        except tokenize.TokenError as ex:
            self.add_message("syntax-error", line=ex.args[1][0], args=ex.args[0])
            return None

        if not ast_node.pure_python:
            self.add_message("raw-checker-failed", args=ast_node.name)
        else:
            # assert astroid.file.endswith('.py')
            # invoke ITokenChecker interface on self to fetch module/block
            # level options
            self.process_tokens(tokens)
            if self._ignore_file:
                return False
            # walk ast to collect line numbers
            self.file_state.collect_block_lines(self.msgs_store, ast_node)
            # run raw and tokens checkers
            for checker in rawcheckers:
                checker.process_module(ast_node)
            for checker in tokencheckers:
                checker.process_tokens(tokens)
        # generate events to astroid checkers
        walker.walk(ast_node)
        return True
def check_astroid_module(self, ast_node, walker, rawcheckers, tokencheckers):
        try:
            tokens = utils.tokenize_module(ast_node)
        except tokenize.TokenError as ex:
            self.add_message("syntax-error", line=ex.args[1][0], args=ex.args[0])
            return None

        if not ast_node.pure_python:
            self.add_message("raw-checker-failed", args=ast_node.name)
        else:
            # assert astroid.file.endswith('.py')
            # invoke ITokenChecker interface on self to fetch module/block
            # level options
            self.process_tokens(tokens)
            if self._ignore_file:
                return False
            # walk ast to collect line numbers
            self.file_state.collect_block_lines(self.msgs_store, ast_node)
            # run raw and tokens checkers
            for checker in rawcheckers:
                checker.process_module(ast_node)
            for checker in tokencheckers:
                checker.process_tokens(tokens)
        # generate events to astroid checkers
        walker.walk(ast_node)
        return True
def check_astroid_module ( self , ast_node , walker , rawcheckers , tokencheckers ) : try : tokens = utils . tokenize_module ( ast_node ) except tokenize . TokenError as ex : self . add_message ( "syntax-error" , line = ex . args [ 1 ] [ 0 ] , args = ex . args [ 0 ] ) return None if not ast_node . pure_python : self . add_message ( "raw-checker-failed" , args = ast_node . name ) else : # assert astroid.file.endswith('.py') # invoke ITokenChecker interface on self to fetch module/block # level options self . process_tokens ( tokens ) if self . _ignore_file : return False # walk ast to collect line numbers self . file_state . collect_block_lines ( self . msgs_store , ast_node ) # run raw and tokens checkers for checker in rawcheckers : checker . process_module ( ast_node ) for checker in tokencheckers : checker . process_tokens ( tokens ) # generate events to astroid checkers walker . walk ( ast_node ) return True
Check a module from its astroid representation.
Check a module from its astroid representation .