Skip to content

Commit

Permalink
Introduce DescriptionLinesWhenSkipped (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored May 30, 2023
1 parent 7da1e00 commit 87c7b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions renderers/config/interactive_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type InteractiveRendererConfig struct {
FailureStatus string
SkippedStatus string
DescriptionLinesWhenFailed int
DescriptionLinesWhenSkipped int
VisibleDescriptionLines int
}

Expand All @@ -40,6 +41,7 @@ func NewDefaultEmojiRenderingConfig() *InteractiveRendererConfig {
FailureStatus: "❌",
SkippedStatus: "⏩",
DescriptionLinesWhenFailed: 100,
DescriptionLinesWhenSkipped: 0,
VisibleDescriptionLines: defaultVisibleLines,
}
}
Expand All @@ -57,6 +59,7 @@ func NewDefaultSymbolsOnlyRenderingConfig() *InteractiveRendererConfig {
FailureStatus: "-",
SkippedStatus: "!",
DescriptionLinesWhenFailed: 100,
DescriptionLinesWhenSkipped: 0,
}
}

Expand Down
4 changes: 3 additions & 1 deletion renderers/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 87c7b42

Please sign in to comment.