mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +00:00
Merge branch 'master' into 'master'
Exit Flake8Command.run() cleanly if style checks pass When using distutils/setuptools, it is common to perform several commands in sequence. For example: `python setup.py flake8 bdist_egg`. When `run()` exits by raising a `SystemExit` exception, it causes the entire chain to break - meaning flake8 cannot be used in combination with any other command. This change simply alters the behavior to exit normally if there were no style violations found. Otherwise, it will exit immediately, as before, with a non-zero exit code. See merge request !8
This commit is contained in:
commit
73b334a6e4
1 changed files with 2 additions and 1 deletions
|
|
@ -32,7 +32,8 @@ def main():
|
|||
report = flake8_style.check_files()
|
||||
|
||||
exit_code = print_report(report, flake8_style)
|
||||
raise SystemExit(exit_code > 0)
|
||||
if exit_code > 0:
|
||||
raise SystemExit(exit_code > 0)
|
||||
|
||||
|
||||
def print_report(report, flake8_style):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue