Exemplo n.º 1
0
def expand_files(files, linter):
    from pylint.utils import expand_modules
    if not linter:
        return expand_modules(files, [], [])
    else:
        return expand_modules(files, linter.config.black_list,
                              linter.config.black_list_re)
Exemplo n.º 2
0
 def expand_files(self, modules):
     """get modules and errors from a list of modules and handle errors
     """
     result, errors = expand_modules(modules, self.config.black_list)
     for error in errors:
         message = modname = error["mod"]
         key = error["key"]
         self.set_current_module(modname)
         if key == "fatal":
             message = str(error["ex"]).replace(os.getcwd() + os.sep, '')
         self.add_message(key, args=message)
     return result
Exemplo n.º 3
0
 def expand_files(self, modules):
     """get modules and errors from a list of modules and handle errors
     """
     result, errors = expand_modules(modules, self.config.black_list)
     for error in errors:
         message = modname = error["mod"]
         key = error["key"]
         self.set_current_module(modname)
         if key == "fatal":
             message = str(error["ex"]).replace(os.getcwd() + os.sep, '')
         self.add_message(key, args=message)
     return result
Exemplo n.º 4
0
 def _module_not_exists(self, node, modname):
     """check if module exists and possibly add message"""
     result, errors = expand_modules([modname], [])
     if not errors or is_relative(modname, node.root().file):
         return False
     error = errors[0]
     if error["key"] == "F0001":
         args = (error["mod"], error["ex"])
         self.add_message("F0401", args=args, node=node)
         return True
     assert error["key"] == "F0003"
     return False