diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index e10be82a..eee6fcfe 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -84,6 +84,7 @@ def _run_single_hook(runner, repository, hook_id, args, write, skips=set()): write(color.format_color(pass_fail, print_color, args.color) + '\n') if (stdout or stderr) and (retcode or args.verbose): + write('hookid: {0}\n'.format(hook['id'])) write('\n') for output in (stdout, stderr): if output.strip(): diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py index acb82fb1..a1c29da8 100644 --- a/tests/commands/install_uninstall_test.py +++ b/tests/commands/install_uninstall_test.py @@ -157,6 +157,7 @@ FAILING_PRE_COMMIT_RUN = re.compile( r'\[INFO\] Once installed this environment will be reused\.\n' r'\[INFO\] This may take a few minutes\.\.\.\n' r'Failing hook\.+Failed\n' + r'hookid: failing_hook\n' r'\n' r'Fail\n' r'foo\n' diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 1e03587b..886c0467 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -77,7 +77,7 @@ def test_run_all_hooks_failing( _test_run( repo_with_failing_hook, {}, - ('Failing hook', 'Failed', 'Fail\nfoo.py\n'), + ('Failing hook', 'Failed', 'hookid: failing_hook', 'Fail\nfoo.py\n'), 1, True, )