add --no-fail arg to trailing whitespace

This commit is contained in:
Adeeb Shihadeh 2020-06-04 16:52:09 -07:00
parent f0bf512dbb
commit 112bcaf3b1

View file

@ -42,6 +42,14 @@ def _process_line(
def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument(
'--no-fail',
action='store_false',
help=(
'Always return a successful return code. '
'Defaults to false.'
),
)
parser.add_argument(
'--no-markdown-linebreak-ext',
action='store_true',
@ -95,6 +103,8 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
if _fix_file(filename, md, chars):
print(f'Fixing {filename}')
return_code = 1
if args.no_fail:
return_code = 0
return return_code