summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Campderrós <carlos.campderros@eyeos.com>2015-07-29 11:27:44 +0200
committerIan Lee <IanLee1521@gmail.com>2016-06-07 21:20:57 -0700
commit06fcbbc624aba51a875c7317b59137efd6e20024 (patch)
tree40f5d241c7e76cf7f8bec92513cb09d5b8612375
parentf8af83d3cce2dace3d780c88ce0c580e30fc1dbd (diff)
downloadpep8-06fcbbc624aba51a875c7317b59137efd6e20024.tar.gz
Print 0 when using --count and there are no violations
Right now nothing is printed if there are no violations
-rwxr-xr-xpycodestyle.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index b32f16e..b3e8d45 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -2058,7 +2058,7 @@ def get_parser(prog='pycodestyle', version=__version__):
parser.add_option('--count', action='store_true',
help="print total number of errors and warnings "
"to standard error and set exit code to 1 if "
- "total is not null")
+ "total is not zero")
parser.add_option('--max-line-length', type='int', metavar='n',
default=MAX_LINE_LENGTH,
help="set maximum allowed line length "
@@ -2246,9 +2246,10 @@ def _main():
if options.testsuite and not options.quiet:
report.print_results()
+ if options.count:
+ sys.stderr.write(str(report.total_errors) + '\n')
+
if report.total_errors:
- if options.count:
- sys.stderr.write(str(report.total_errors) + '\n')
sys.exit(1)