mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Print hookid on failure.
This commit is contained in:
parent
196fd87df0
commit
b8c8120f2a
3 changed files with 3 additions and 1 deletions
|
|
@ -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')
|
write(color.format_color(pass_fail, print_color, args.color) + '\n')
|
||||||
|
|
||||||
if (stdout or stderr) and (retcode or args.verbose):
|
if (stdout or stderr) and (retcode or args.verbose):
|
||||||
|
write('hookid: {0}\n'.format(hook['id']))
|
||||||
write('\n')
|
write('\n')
|
||||||
for output in (stdout, stderr):
|
for output in (stdout, stderr):
|
||||||
if output.strip():
|
if output.strip():
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ FAILING_PRE_COMMIT_RUN = re.compile(
|
||||||
r'\[INFO\] Once installed this environment will be reused\.\n'
|
r'\[INFO\] Once installed this environment will be reused\.\n'
|
||||||
r'\[INFO\] This may take a few minutes\.\.\.\n'
|
r'\[INFO\] This may take a few minutes\.\.\.\n'
|
||||||
r'Failing hook\.+Failed\n'
|
r'Failing hook\.+Failed\n'
|
||||||
|
r'hookid: failing_hook\n'
|
||||||
r'\n'
|
r'\n'
|
||||||
r'Fail\n'
|
r'Fail\n'
|
||||||
r'foo\n'
|
r'foo\n'
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ def test_run_all_hooks_failing(
|
||||||
_test_run(
|
_test_run(
|
||||||
repo_with_failing_hook,
|
repo_with_failing_hook,
|
||||||
{},
|
{},
|
||||||
('Failing hook', 'Failed', 'Fail\nfoo.py\n'),
|
('Failing hook', 'Failed', 'hookid: failing_hook', 'Fail\nfoo.py\n'),
|
||||||
1,
|
1,
|
||||||
True,
|
True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue