mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
add helpful message and test
This commit is contained in:
committed by
Anthony Sottile
parent
03ac3b0840
commit
71a740d65d
@@ -215,7 +215,14 @@ def _run_hooks(config, hooks, args, environ):
|
||||
if retval and config['fail_fast']:
|
||||
break
|
||||
if retval and args.show_diff_on_failure and git.has_diff():
|
||||
output.write_line('All changes made by hooks:')
|
||||
if args.all_files:
|
||||
output.write_line(
|
||||
'Pre-commit hook(s) made changes. '
|
||||
'If you are seeing this message on CI,'
|
||||
' reproduce locally with: pre-commit run --all-files',
|
||||
)
|
||||
else:
|
||||
output.write_line('All changes made by hooks:')
|
||||
subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
|
||||
return retval
|
||||
|
||||
|
||||
Reference in New Issue
Block a user