mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-26 02:49:09 -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:
6
testing/resources/logfile_repo/.pre-commit-hooks.yaml
Normal file
6
testing/resources/logfile_repo/.pre-commit-hooks.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
- id: logfile test hook
|
||||
name: Logfile test hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: .
|
||||
log_file: test.log
|
||||
5
testing/resources/logfile_repo/bin/hook.sh
Executable file
5
testing/resources/logfile_repo/bin/hook.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "This is STDOUT output"
|
||||
echo "This is STDERR output" 1>&2
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user