summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-06-12 13:28:55 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-06-12 13:28:55 +0200
commit0380bd42bbcb0b7e807512cd34803936460e04b5 (patch)
tree914cac3b350f55f7f0b49e53b3d152caf86f8201
parent32b44a3924db4986dd838d9aac213f9006c33215 (diff)
downloadpep8-0380bd42bbcb0b7e807512cd34803936460e04b5.tar.gz
Reserve the FileReport for the script mode; honour the quiet=True argument when using the library.
-rwxr-xr-xpep8.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/pep8.py b/pep8.py
index 5cc70ad..7f5ab8b 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1521,6 +1521,12 @@ class StyleGuide(object):
if 'paths' in options_dict:
self.paths = options_dict['paths']
+ if not options.reporter:
+ if options.quiet:
+ options.reporter = BasicReport
+ else:
+ options.reporter = StandardReport
+
for index, value in enumerate(options.exclude):
options.exclude[index] = value.rstrip('/')
if not options.select:
@@ -1845,6 +1851,7 @@ def process_options(arglist=None):
help='set the error format [default|pylint|<custom>]')
options, args = parser.parse_args(arglist)
+ options.reporter = None
if options.show_pep8:
options.repeat = False
if options.testsuite:
@@ -1856,6 +1863,8 @@ def process_options(arglist=None):
else:
parser.error('input not specified')
options = read_config(options, args, arglist, parser)
+ if options.quiet == 1 and arglist is None:
+ options.reporter = FileReport
options.exclude = options.exclude.split(',')
if options.filename:
@@ -1871,13 +1880,6 @@ def process_options(arglist=None):
# (for doctest and testsuite, all checks are required)
options.ignore = DEFAULT_IGNORE.split(',')
- if not options.quiet:
- options.reporter = StandardReport
- elif options.quiet == 1:
- options.reporter = FileReport
- else:
- options.reporter = BasicReport
-
return options, args