Add quiet mode to pre-commit run

This commit is contained in:
allburov 2019-11-11 17:49:10 +07:00
parent 0fd4a2ea38
commit 53670d6a7e
7 changed files with 268 additions and 29 deletions

View file

@ -0,0 +1,15 @@
- id: passing_hook
name: Passing hook
entry: bin/hook.sh
args: ['0']
language: script
- id: failing_hook
name: Failing hook
entry: bin/hook.sh
args: ['1']
language: script
- id: skipping_hook
name: Skipping hook
entry: bin/hook.sh
language: script
files: 'no-exist-file'

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
echo $@
echo 'Hello World'
exit $1

View file

@ -107,6 +107,7 @@ def run_opts(
hook_stage='commit',
show_diff_on_failure=False,
commit_msg_filename='',
quiet=False,
):
# These are mutually exclusive
assert not (all_files and files)
@ -121,6 +122,7 @@ def run_opts(
hook_stage=hook_stage,
show_diff_on_failure=show_diff_on_failure,
commit_msg_filename=commit_msg_filename,
quiet=quiet,
)