mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
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:
parent
8db02bd550
commit
294f49275d
1 changed files with 3 additions and 0 deletions
|
|
@ -347,6 +347,9 @@ def run(
|
||||||
if args.checkout_type:
|
if args.checkout_type:
|
||||||
environ['PRE_COMMIT_CHECKOUT_TYPE'] = 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:
|
with contextlib.ExitStack() as exit_stack:
|
||||||
if stash:
|
if stash:
|
||||||
exit_stack.enter_context(staged_files_only(store.directory))
|
exit_stack.enter_context(staged_files_only(store.directory))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue