diff --git a/flake8/pep8.py b/flake8/pep8.py index 766302b..80cbfe6 100644 --- a/flake8/pep8.py +++ b/flake8/pep8.py @@ -1287,6 +1287,9 @@ def process_options(arglist=None): help="exclude files or directories which match these " "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE) + parser.add_option('--exit-zero', action='store_true', + help="use exit code 0 (success), even if there are " + "warnings") parser.add_option('--filename', metavar='patterns', default='*.py', help="when parsing directories, only check filenames " "matching these comma separated patterns (default: " diff --git a/flake8/run.py b/flake8/run.py index 8683e50..7900e56 100644 --- a/flake8/run.py +++ b/flake8/run.py @@ -59,6 +59,9 @@ def main(): else: stdin = sys.stdin.read() warnings += check_code(stdin, complexity) + + if options.exit_zero: + raise SystemExit(0) raise SystemExit(warnings > 0)