mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-15 20:59:26 -06:00
Add a hook option that allows stdout to be printed when exit code is 0 (#695)
This commit is contained in:
@@ -68,6 +68,7 @@ MANIFEST_HOOK_DICT = schema.Map(
|
||||
schema.Optional('log_file', schema.check_string, ''),
|
||||
schema.Optional('minimum_pre_commit_version', schema.check_string, '0'),
|
||||
schema.Optional('stages', schema.check_array(schema.check_string), []),
|
||||
schema.Optional('verbose', schema.check_bool, False),
|
||||
)
|
||||
MANIFEST_SCHEMA = schema.Array(MANIFEST_HOOK_DICT)
|
||||
|
||||
|
||||
@@ -130,7 +130,10 @@ def _run_single_hook(filenames, hook, repo, args, skips, cols):
|
||||
|
||||
output.write_line(color.format_color(pass_fail, print_color, args.color))
|
||||
|
||||
if (stdout or stderr or file_modifications) and (retcode or args.verbose):
|
||||
if (
|
||||
(stdout or stderr or file_modifications) and
|
||||
(retcode or args.verbose or hook['verbose'])
|
||||
):
|
||||
output.write_line('hookid: {}\n'.format(hook['id']))
|
||||
|
||||
# Print a message if failing due to file modifications
|
||||
|
||||
Reference in New Issue
Block a user