Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip option for the summary separator #570

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/lefthook/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,13 @@ func printSummary(
return
}

log.Separate(
log.Cyan("summary: ") + log.Gray(fmt.Sprintf("(done in %.2f seconds)", duration.Seconds())),
)
if logSettings.SkipSummarySeparator() {
log.Info(log.Cyan("summary: ") + log.Gray(fmt.Sprintf("(done in %.2f seconds)", duration.Seconds())))
} else {
log.Separate(
log.Cyan("summary: ") + log.Gray(fmt.Sprintf("(done in %.2f seconds)", duration.Seconds())),
)
}

if !logSettings.SkipSuccess() {
for _, result := range results {
Expand Down
7 changes: 7 additions & 0 deletions internal/log/skip_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
skipExecutionOutput
skipExecutionInfo
skipEmptySummary
skipSummarySeparator
)

type SkipSettings int16
Expand All @@ -34,6 +35,8 @@ func (s *SkipSettings) ApplySetting(setting string) {
*s |= skipExecutionInfo
case "empty_summary":
*s |= skipEmptySummary
case "summary_separator":
*s |= skipSummarySeparator
}
}

Expand Down Expand Up @@ -73,6 +76,10 @@ func (s SkipSettings) SkipEmptySummary() bool {
return s.doSkip(skipEmptySummary)
}

func (s SkipSettings) SkipSummarySeparator() bool {
return s.doSkip(skipSummarySeparator)
}

func (s SkipSettings) doSkip(option int16) bool {
return int16(s)&option != 0
}