Success should not be silent in --quiet mode

Adding a new summary line if all hooks passed
or were skipped in either --quiet mode (where
it may be the only output) or --verbose mode
(since the summary seems worth showing here).
This commit is contained in:
Peter Cock 2020-08-22 23:19:46 +01:00
parent 5c1a7499cf
commit f8c8b7ee8a

View file

@ -298,6 +298,12 @@ def _run_hooks(
retval |= current_retval
if retval and config['fail_fast']:
break
if (args.quiet or args.verbose) and not retval:
# Do not want success with --quiet to be absolutely silent
# (would not know if any checks have been made at all)
output.write_line(
f'All {len(hooks)} pre-commit hook(s) passed or skipped',
)
if retval and args.show_diff_on_failure and prior_diff:
if args.all_files:
output.write_line(