mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 10:46:54 +00:00
Implement --exit-zero functionality
This commit is contained in:
parent
d8635bb92a
commit
3ad798db61
1 changed files with 5 additions and 1 deletions
|
|
@ -197,6 +197,10 @@ class Application(object):
|
|||
self.args = None
|
||||
self.result_count = 0
|
||||
|
||||
def exit(self):
|
||||
if not self.options.exit_zero:
|
||||
raise SystemExit(self.result_count > 0)
|
||||
|
||||
def find_plugins(self):
|
||||
# type: () -> NoneType
|
||||
"""Find and load the plugins for this application."""
|
||||
|
|
@ -309,4 +313,4 @@ def main(argv=None):
|
|||
"""Main entry-point for the flake8 command-line tool."""
|
||||
app = Application()
|
||||
app.run(argv)
|
||||
raise SystemExit(app.result_count > 0)
|
||||
app.exit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue