mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
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:
parent
5c1a7499cf
commit
f8c8b7ee8a
1 changed files with 6 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue