From 12dde6d395e3bc2eb2f735245be40ca1855c28e2 Mon Sep 17 00:00:00 2001 From: Peter Cock Date: Sat, 15 Aug 2020 22:14:56 +0100 Subject: [PATCH] Only show skipped messages in verbose mode --- pre_commit/commands/run.py | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index 567b7cd3..73dcc2f8 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -140,30 +140,32 @@ def _run_single_hook( filenames = classifier.filenames_for_hook(hook) if hook.id in skips or hook.alias in skips: - output.write( - _full_msg( - start=hook.name, - end_msg=SKIPPED, - end_color=color.YELLOW, - use_color=use_color, - cols=cols, - ), - ) + if verbose: + output.write( + _full_msg( + start=hook.name, + end_msg=SKIPPED, + end_color=color.YELLOW, + use_color=use_color, + cols=cols, + ), + ) duration = None retcode = 0 files_modified = False out = b'' elif not filenames and not hook.always_run: - output.write( - _full_msg( - start=hook.name, - postfix=NO_FILES, - end_msg=SKIPPED, - end_color=color.TURQUOISE, - use_color=use_color, - cols=cols, - ), - ) + if verbose: + output.write( + _full_msg( + start=hook.name, + postfix=NO_FILES, + end_msg=SKIPPED, + end_color=color.TURQUOISE, + use_color=use_color, + cols=cols, + ), + ) duration = None retcode = 0 files_modified = False