Example #1
0
def main():
    options, args = pep8.process_options()
    complexity = options.max_complexity
    warnings = 0
    if args:
        for path in _get_python_files(args):
            warnings += check_file(path, complexity)
    else:
        stdin = sys.stdin.read()
        warnings += check_code(stdin, complexity)

    raise SystemExit(warnings > 0)
Example #2
0
def main():
    options, args = pep8.process_options()
    complexity = options.max_complexity
    builtins = set(options.builtins)
    warnings = 0

    if builtins:
        orig_builtins = set(pyflakes._MAGIC_GLOBALS)
        pyflakes._MAGIC_GLOBALS = orig_builtins | builtins
    if args:
        for path in _get_python_files(args):
            warnings += check_file(path, complexity)
    else:
        stdin = sys.stdin.read()
        warnings += check_code(stdin, complexity)

    if options.exit_zero:
        raise SystemExit(0)
    raise SystemExit(warnings > 0)
Example #3
0
def main():
    options, args = pep8.process_options()
    complexity = options.max_complexity
    builtins = set(options.builtins)
    warnings = 0

    if builtins:
        orig_builtins = set(pyflakes._MAGIC_GLOBALS)
        pyflakes._MAGIC_GLOBALS = orig_builtins | builtins
    if args:
        for path in _get_python_files(args):
            warnings += check_file(path, complexity)
    else:
        stdin = sys.stdin.read()
        warnings += check_code(stdin, complexity)

    if options.exit_zero:
        raise SystemExit(0)
    raise SystemExit(warnings > 0)