From 833b89211acabca926d31049b94680c21fc246ec Mon Sep 17 00:00:00 2001 From: Sagi Cohen Date: Sun, 9 Jun 2024 13:34:03 +0300 Subject: [PATCH] fix: Refactor human policy formatter --- internal/outputer/formatter/formatter_human.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/internal/outputer/formatter/formatter_human.go b/internal/outputer/formatter/formatter_human.go index 44d94885..3212d66d 100644 --- a/internal/outputer/formatter/formatter_human.go +++ b/internal/outputer/formatter/formatter_human.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/Legit-Labs/legitify/internal/common/severity" + "github.com/fatih/color" tw "github.com/olekukonko/tablewriter" + "github.com/Legit-Labs/legitify/internal/common/severity" "github.com/Legit-Labs/legitify/internal/outputer/scheme" - "github.com/fatih/color" ) type HumanFormatter struct { @@ -152,13 +152,9 @@ func (hp humanPolicyFormatter) FormatList(depth int, title string, list []string } var sb strings.Builder - bullet := "-" sb.WriteString(hp.FormatText(depth, "%s\n", title)) - for i, step := range list { - if ordered { - bullet = fmt.Sprintf("%d.", i+1) - } - sb.WriteString(hp.FormatText(depth, "%s %s\n", bullet, step)) + for _, step := range list { + sb.WriteString(hp.FormatText(depth, "%s\n", step)) } return sb.String()