Skip to content

Commit 985d83f

Browse files
committed
fix(cli): rewrite suppress-render if-else chain as switch (gocritic)
CI golangci-lint flagged ifElseChain on the new policiesTable suppress-only branch. Same logic, expressed as the switch the linter asked for. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 5bd2a917-fb7b-400c-9772-60ba6af6c9af, b66717f5-626e-4c20-8d33-59c129b5885d
1 parent 8da5a05 commit 985d83f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/cli/cmd/workflow_workflow_run_describe.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,12 @@ func policiesTable(evs []*action.PolicyEvaluation, mt table.Writer, debugMode bo
283283
// When every finding is suppressed the gate passed; lead with
284284
// "Ok" so the row carries the same signal as the no-violations
285285
// case rather than reading like a failure.
286-
if !hasActive {
286+
switch {
287+
case !hasActive:
287288
msg = text.Colors{text.FgHiGreen}.Sprint("Ok") + "\n - " + strings.Join(lines, "\n - ")
288-
} else if len(lines) == 1 {
289+
case len(lines) == 1:
289290
msg = lines[0]
290-
} else {
291+
default:
291292
msg = "\n - " + strings.Join(lines, "\n - ")
292293
}
293294
}

0 commit comments

Comments
 (0)