mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
add --no-fail arg to trailing whitespace
This commit is contained in:
parent
f0bf512dbb
commit
112bcaf3b1
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue