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:
Ian Cordasco 2014-12-06 03:49:30 +00:00
commit 73b334a6e4

View file

@ -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):