From e0b2c9c6afd811835e29b1af57d0f6cfe17b0af5 Mon Sep 17 00:00:00 2001 From: "anchore-actions-token-generator[bot]" <102182147+anchore-actions-token-generator[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:05:44 +0000 Subject: [PATCH] chore(deps): update tools to latest versions (#2102) * chore(deps): update tools to latest versions Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: westonsteimel <1593939+westonsteimel@users.noreply.github.com> Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> --- .binny.yaml | 8 ++++---- .golangci.yaml | 2 +- .../cli/ui/handle_update_vulnerability_database.go | 12 +++++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.binny.yaml b/.binny.yaml index 9ab5d687..b3654ec0 100644 --- a/.binny.yaml +++ b/.binny.yaml @@ -26,7 +26,7 @@ tools: # used for linting - name: golangci-lint version: - want: v1.60.3 + want: v1.61.0 method: github-release with: repo: golangci/golangci-lint @@ -58,7 +58,7 @@ tools: # used to release all artifacts - name: goreleaser version: - want: v2.2.0 + want: v2.3.0 method: github-release with: repo: goreleaser/goreleaser @@ -90,7 +90,7 @@ tools: # used for running all local and CI tasks - name: task version: - want: v3.38.0 + want: v3.39.0 method: github-release with: repo: go-task/task @@ -98,7 +98,7 @@ tools: # used for triggering a release - name: gh version: - want: v2.55.0 + want: v2.56.0 method: github-release with: repo: cli/cli diff --git a/.golangci.yaml b/.golangci.yaml index 184f0f8e..7188b9b1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -15,7 +15,7 @@ linters: - dogsled - dupl - errcheck - - exportloopref + - copyloopvar - funlen - gocognit - goconst diff --git a/cmd/grype/cli/ui/handle_update_vulnerability_database.go b/cmd/grype/cli/ui/handle_update_vulnerability_database.go index 51c9a078..6547b97b 100644 --- a/cmd/grype/cli/ui/handle_update_vulnerability_database.go +++ b/cmd/grype/cli/ui/handle_update_vulnerability_database.go @@ -27,7 +27,10 @@ func (s dbDownloadProgressStager) Stage() string { return "validating" } // show intermediate progress of the download - return fmt.Sprintf("%s / %s", humanize.Bytes(uint64(s.prog.Current())), humanize.Bytes(uint64(s.prog.Size()))) + return fmt.Sprintf("%s / %s", + humanize.Bytes(safeConvertInt64ToUint64(s.prog.Current())), + humanize.Bytes(safeConvertInt64ToUint64(s.prog.Size())), + ) } return stage } @@ -51,3 +54,10 @@ func (m *Handler) handleUpdateVulnerabilityDatabase(e partybus.Event) ([]tea.Mod return []tea.Model{tsk}, nil } + +func safeConvertInt64ToUint64(i int64) uint64 { + if i < 0 { + return 0 + } + return uint64(i) +}