diff options
Diffstat (limited to 'pylint/lint.py')
-rw-r--r-- | pylint/lint.py | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/pylint/lint.py b/pylint/lint.py index 5cfec9bf7..bbdeada14 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -962,11 +962,9 @@ class PyLinter( results_queue = manager.Queue() # Send files to child linters. - expanded_files = [] - for descr in self.expand_files(files_or_modules): - modname, filepath, is_arg = descr["name"], descr["path"], descr["isarg"] - if self.should_analyze_file(modname, filepath, is_argument=is_arg): - expanded_files.append(descr) + expanded_files = utils.expand_files( + files_or_modules, self, self.config.black_list, self.config.black_list_re + ) # do not start more jobs than needed for _ in range(min(self.config.jobs, len(expanded_files))): @@ -1046,7 +1044,10 @@ class PyLinter( if interfaces.implements(checker, interfaces.IAstroidChecker): walker.add_checker(checker) # build ast and check modules or packages - for module_desc in self.expand_files(files_or_modules): + expanded_files = utils.expand_files( + files_or_modules, self, self.config.black_list, self.config.black_list_re + ) + for module_desc in expanded_files: modname = module_desc.name filepath = module_desc.path if not module_desc.isarg and not self.should_analyze_file( @@ -1079,21 +1080,6 @@ class PyLinter( for checker in reversed(_checkers): checker.close() - def expand_files(self, modules): - """get modules and errors from a list of modules and handle errors - """ - result, errors = utils.expand_modules( - modules, self.config.black_list, self.config.black_list_re - ) - 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 - def set_current_module(self, modname, filepath=None): """set the name of the currently analyzed module and init statistics for it |