From 87c7b423b345e0900da54f9243316589bb5b4de4 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 30 May 2023 10:59:40 +0400 Subject: [PATCH] Introduce DescriptionLinesWhenSkipped (#26) --- renderers/config/interactive_config.go | 3 +++ renderers/interactive.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/renderers/config/interactive_config.go b/renderers/config/interactive_config.go index bff961b..53ed13e 100644 --- a/renderers/config/interactive_config.go +++ b/renderers/config/interactive_config.go @@ -17,6 +17,7 @@ type InteractiveRendererConfig struct { FailureStatus string SkippedStatus string DescriptionLinesWhenFailed int + DescriptionLinesWhenSkipped int VisibleDescriptionLines int } @@ -40,6 +41,7 @@ func NewDefaultEmojiRenderingConfig() *InteractiveRendererConfig { FailureStatus: "❌", SkippedStatus: "⏩", DescriptionLinesWhenFailed: 100, + DescriptionLinesWhenSkipped: 0, VisibleDescriptionLines: defaultVisibleLines, } } @@ -57,6 +59,7 @@ func NewDefaultSymbolsOnlyRenderingConfig() *InteractiveRendererConfig { FailureStatus: "-", SkippedStatus: "!", DescriptionLinesWhenFailed: 100, + DescriptionLinesWhenSkipped: 0, } } diff --git a/renderers/interactive.go b/renderers/interactive.go index cc67961..fb5aa69 100644 --- a/renderers/interactive.go +++ b/renderers/interactive.go @@ -65,7 +65,9 @@ func (r *InteractiveRenderer) RenderScopeFinished(entry *echelon.LogScopeFinishe n.SetVisibleDescriptionLines(r.config.DescriptionLinesWhenFailed) n.CompleteWithColor(r.config.FailureStatus, r.config.Colors.FailureColor) case echelon.FinishTypeSkipped: - if n != r.rootNode { + if r.config.DescriptionLinesWhenSkipped != 0 { + n.SetVisibleDescriptionLines(r.config.DescriptionLinesWhenSkipped) + } else if n != r.rootNode { n.ClearAllChildren() n.ClearDescription() }