mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +00:00
Merge branch 'issue/31' into 'master'
Add FileQReport to replace pep8's FileReport when using multiprocessing See merge request !21
This commit is contained in:
commit
96817b40b2
2 changed files with 12 additions and 2 deletions
|
|
@ -6,7 +6,8 @@ import pep8
|
|||
|
||||
from flake8 import __version__
|
||||
from flake8 import callbacks
|
||||
from flake8.reporter import multiprocessing, BaseQReport, QueueReport
|
||||
from flake8.reporter import (multiprocessing, BaseQReport, FileQReport,
|
||||
QueueReport)
|
||||
from flake8.util import OrderedSet, is_windows, is_using_stdin
|
||||
|
||||
_flake8_noqa = re.compile(r'\s*# flake8[:=]\s*noqa', re.I).search
|
||||
|
|
@ -137,7 +138,11 @@ def get_style_guide(**kwargs):
|
|||
n_jobs = 1
|
||||
if n_jobs > 1:
|
||||
options.jobs = n_jobs
|
||||
reporter = BaseQReport if options.quiet else QueueReport
|
||||
reporter = QueueReport
|
||||
if options.quiet:
|
||||
reporter = BaseQReport
|
||||
if options.quiet == 1:
|
||||
reporter = FileQReport
|
||||
report = styleguide.init_report(reporter)
|
||||
report.input_file = styleguide.input_file
|
||||
styleguide.runner = report.task_queue.put
|
||||
|
|
|
|||
|
|
@ -92,6 +92,11 @@ class BaseQReport(pep8.BaseReport):
|
|||
self.messages.update(state['messages'])
|
||||
|
||||
|
||||
class FileQReport(BaseQReport):
|
||||
"""File Queue Report."""
|
||||
print_filename = True
|
||||
|
||||
|
||||
class QueueReport(pep8.StandardReport, BaseQReport):
|
||||
"""Standard Queue Report."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue