mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-25 02:08:41 -06:00
Adds support for 'log_file' in hook config
Specify a filename on a per hook basis and pre-commit will write the STDOUT and STDERR of that hook into the file. Useful for CI. Resolves #499.
This commit is contained in:
@@ -121,7 +121,10 @@ def _run_single_hook(hook, repo, args, skips, cols):
|
||||
for out in (stdout, stderr):
|
||||
assert type(out) is bytes, type(out)
|
||||
if out.strip():
|
||||
output.write_line(out.strip())
|
||||
output.write_line(
|
||||
out.strip(),
|
||||
logfile_name=hook.get('log_file'),
|
||||
)
|
||||
output.write_line()
|
||||
|
||||
return retcode
|
||||
|
||||
Reference in New Issue
Block a user