Expose verbosity to called hooks

Allows hooks to check if pre-commit was called with verbose mode
in order to change their behavior.

Fixes: 1199
This commit is contained in:
Sorin Sbarnea 2020-05-09 11:51:15 +01:00
parent 8db02bd550
commit 294f49275d

View file

@ -347,6 +347,9 @@ def run(
if args.checkout_type:
environ['PRE_COMMIT_CHECKOUT_TYPE'] = args.checkout_type
if args.verbose:
environ['PRE_COMMIT_VERBOSE'] = '1'
with contextlib.ExitStack() as exit_stack:
if stash:
exit_stack.enter_context(staged_files_only(store.directory))