Skip to content

Commit

Permalink
Add support for skip summary output
Browse files Browse the repository at this point in the history
  • Loading branch information
washtubs committed May 18, 2021
1 parent e0d4765 commit 7b94e77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const (
parallelConfigKey string = "parallel"
skipOutputConfigKey string = "skip_output"
outputMeta string = "meta"
outputSummary string = "summary"
outputSuccess string = "success"
subFiles string = "{files}"
subAllFiles string = "{all_files}"
Expand Down Expand Up @@ -418,6 +419,10 @@ func printMeta(hooksGroup string) {
}

func printSummary(execTime time.Duration) {
if isSkipPrintOutput(outputSummary) {
return
}

if len(okList) == 0 && len(failList) == 0 {
log.Println(au.Cyan("\nSUMMARY:"), au.Brown("(SKIP EMPTY)"))
} else {
Expand Down
18 changes: 17 additions & 1 deletion docs/full_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ If you need to extend config from some another place, just add top level:
```yml
# lefthook.yml
extends:
extends:
- $HOME/work/lefthook-extend.yml
- $HOME/work/lefthook-extend-2.yml
```
Expand Down Expand Up @@ -469,6 +469,22 @@ source_dir: ".lefthook"
source_dir_local: ".lefthook-local"
```

## Mange verbosity

You can manage the verbosity using the `skip_output` config.

Possible values are `meta,success,failure,summary`.

This config quiets all outputs except failures:

```yml
# lefthook.yml
skip_output:
- meta
- success
- summary
```
## CI integration

Enable `CI` env variable if it doens't exists on your service by default.
Expand Down

0 comments on commit 7b94e77

Please sign in to comment.