mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 10:46:54 +00:00
Print the total number of errors before exiting
This commit is contained in:
parent
3ad798db61
commit
a82f8cb580
1 changed files with 11 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
"""Command-line implementation of flake8."""
|
||||
from __future__ import print_function
|
||||
|
||||
import logging
|
||||
|
||||
import flake8
|
||||
|
|
@ -198,6 +200,15 @@ class Application(object):
|
|||
self.result_count = 0
|
||||
|
||||
def exit(self):
|
||||
# type: () -> NoneType
|
||||
"""Handle finalization and exiting the program.
|
||||
|
||||
This should be the last thing called on the application instance. It
|
||||
will check certain options and exit appropriately.
|
||||
"""
|
||||
if self.options.count:
|
||||
print(self.result_count)
|
||||
|
||||
if not self.options.exit_zero:
|
||||
raise SystemExit(self.result_count > 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue