From ea14035852613c4243ff86dfd757564456e0ab15 Mon Sep 17 00:00:00 2001 From: Christopher Phillips Date: Wed, 20 Dec 2023 14:00:56 -0500 Subject: [PATCH] chore: update code static analysis Signed-off-by: Christopher Phillips --- cmd/grant/cli/internal/check/report.go | 1 - cmd/grant/cli/tui/handle_task_started.go | 2 +- grant/case.go | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/grant/cli/internal/check/report.go b/cmd/grant/cli/internal/check/report.go index 4dd0f6b..4819de5 100644 --- a/cmd/grant/cli/internal/check/report.go +++ b/cmd/grant/cli/internal/check/report.go @@ -75,7 +75,6 @@ func (r *Report) Render() error { return r.renderCheckTree() case JSON: return r.renderJSON() - return errors.New("json format not yet supported") } return errors.Join(r.errors...) } diff --git a/cmd/grant/cli/tui/handle_task_started.go b/cmd/grant/cli/tui/handle_task_started.go index 193c316..7ecc49f 100644 --- a/cmd/grant/cli/tui/handle_task_started.go +++ b/cmd/grant/cli/tui/handle_task_started.go @@ -11,7 +11,7 @@ import ( func (m *Handler) handleTaskStarted(e partybus.Event) ([]tea.Model, tea.Cmd) { cmd, prog, err := event.ParseTaskStarted(e) if err != nil { - //log.Warnf("unable to parse event: %+v", err) + // log.Warnf("unable to parse event: %+v", err) return nil, nil } diff --git a/grant/case.go b/grant/case.go index b2b888d..1c29340 100644 --- a/grant/case.go +++ b/grant/case.go @@ -43,11 +43,11 @@ type Case struct { func NewCases(p Policy, userInputs ...string) []Case { cases := make([]Case, 0) ch, err := NewCaseHandler() - defer ch.Close() if err != nil { log.Errorf("unable to create case handler: %+v", err) return cases } + defer ch.Close() for _, userInput := range userInputs { c, err := ch.determineRequestCase(userInput) if err != nil { @@ -161,6 +161,7 @@ func (ch *CaseHandler) handleFile(path string) (c Case, err error) { sb, _, _, err := format.NewDecoderCollection(format.Decoders()...).Decode(bytes) if err != nil { + log.Debugf("unable to determine SBOM or licenses for %s: %+v", path, err) // we want to log the error, but we don't want to return yet } if sb != nil {