diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-03-24 12:56:12 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-03-24 12:56:12 +0200 |
commit | 65d557e7c1f5e7b224621b6c18aa930b891b8da4 (patch) | |
tree | a09c73d096d37b5b65e8dbc5cb52f94163c3b11a /pylint/lint.py | |
parent | 278adeb1be76250357d1c626ac8baf383de37ded (diff) | |
download | pylint-65d557e7c1f5e7b224621b6c18aa930b891b8da4.tar.gz |
Improve the performance of --jobs when dealing only with a package name.
The performance is improved by obtaining the files which should be analyzed
from the list of given modules, using PyLinter.expand_modules. This is already
what PyLinter._do_check does, but the behaviour was missing from PyLinter._parallel_check.
Closes issue #479.
Diffstat (limited to 'pylint/lint.py')
-rw-r--r-- | pylint/lint.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pylint/lint.py b/pylint/lint.py index c03c555..0df8475 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -774,13 +774,15 @@ class PyLinter(configuration.OptionsManagerMixIn, cl.start() # pylint: disable=no-member childs.append(cl) - # send files to child linters - for files_or_module in files_or_modules: - tasks_queue.put([files_or_module]) + # Send files to child linters. + expanded_files = self.expand_files(files_or_modules) + for files_or_module in expanded_files: + path = files_or_module['path'] + tasks_queue.put([path]) # collect results from child linters failed = False - for _ in files_or_modules: + for _ in expanded_files: try: result = results_queue.get() except Exception as ex: @@ -806,6 +808,7 @@ class PyLinter(configuration.OptionsManagerMixIn, self.open() all_stats = [] + module = None for result in self._parallel_task(files_or_modules): ( file_or_module, @@ -816,9 +819,6 @@ class PyLinter(configuration.OptionsManagerMixIn, msg_status ) = result - if file_or_module == files_or_modules[-1]: - last_module = module - for msg in messages: msg = utils.Message(*msg) self.set_current_module(module) @@ -828,7 +828,7 @@ class PyLinter(configuration.OptionsManagerMixIn, self.msg_status |= msg_status self.stats = _merge_stats(itertools.chain(all_stats, [self.stats])) - self.current_name = last_module + self.current_name = module # Insert stats data to local checkers. for checker in self.get_checkers(): |