From 74c61f3698d70c76ddfcc7f6c9dbe50f731d99bb Mon Sep 17 00:00:00 2001 From: Snider Date: Sat, 21 Feb 2026 19:54:51 +0000 Subject: [PATCH] fix: resolve vet warnings and remove stale workflows - Fix 11 non-constant format string warnings in cmd/session (use cli.Print format args instead of fmt.Sprintf wrapper) - Remove leftover .github/workflows/ from cmd/updater (ci.yml and release.yml from when updater was standalone) Co-Authored-By: Virgil --- cmd/session/cmd_session.go | 34 +++++++++++------------ cmd/updater/.github/workflows/ci.yml | 25 ----------------- cmd/updater/.github/workflows/release.yml | 24 ---------------- 3 files changed, 17 insertions(+), 66 deletions(-) delete mode 100644 cmd/updater/.github/workflows/ci.yml delete mode 100644 cmd/updater/.github/workflows/release.yml diff --git a/cmd/session/cmd_session.go b/cmd/session/cmd_session.go index e81a01d4..caa49984 100644 --- a/cmd/session/cmd_session.go +++ b/cmd/session/cmd_session.go @@ -64,11 +64,11 @@ func addListCommand(parent *cli.Command) { return nil } - cli.Print(cli.HeaderStyle.Render("Recent Sessions")) - cli.Print("") + cli.Print("%s", cli.HeaderStyle.Render("Recent Sessions")) + cli.Print("%s", "") for i, s := range sessions { if i >= 20 { - cli.Print(cli.DimStyle.Render(fmt.Sprintf(" ... and %d more", len(sessions)-20))) + cli.Print(" ... and %d more", len(sessions)-20) break } dur := s.EndTime.Sub(s.StartTime) @@ -80,10 +80,10 @@ func addListCommand(parent *cli.Command) { if len(id) > 8 { id = id[:8] } - cli.Print(fmt.Sprintf(" %s %s%s", + cli.Print(" %s %s%s", cli.ValueStyle.Render(id), s.StartTime.Format("2006-01-02 15:04"), - cli.DimStyle.Render(durStr))) + cli.DimStyle.Render(durStr)) } return nil }, @@ -106,7 +106,7 @@ func addReplayCommand(parent *cli.Command) { return fmt.Errorf("session not found: %s", id) } - cli.Print(fmt.Sprintf("Parsing %s...", cli.ValueStyle.Render(filepath.Base(path)))) + cli.Print("Parsing %s...", cli.ValueStyle.Render(filepath.Base(path))) sess, err := session.ParseTranscript(path) if err != nil { @@ -119,8 +119,8 @@ func addReplayCommand(parent *cli.Command) { toolCount++ } } - cli.Print(fmt.Sprintf(" %d events, %d tool calls", - len(sess.Events), toolCount)) + cli.Print(" %d events, %d tool calls", + len(sess.Events), toolCount) // HTML output htmlPath := output @@ -130,15 +130,15 @@ func addReplayCommand(parent *cli.Command) { if err := session.RenderHTML(sess, htmlPath); err != nil { return fmt.Errorf("render html: %w", err) } - cli.Print(cli.SuccessStyle.Render(fmt.Sprintf(" HTML: %s", htmlPath))) + cli.Print("%s", cli.SuccessStyle.Render(fmt.Sprintf(" HTML: %s", htmlPath))) // MP4 output if mp4 { mp4Path := strings.TrimSuffix(htmlPath, ".html") + ".mp4" if err := session.RenderMP4(sess, mp4Path); err != nil { - cli.Print(cli.ErrorStyle.Render(fmt.Sprintf(" MP4: %s", err))) + cli.Print("%s", cli.ErrorStyle.Render(fmt.Sprintf(" MP4: %s", err))) } else { - cli.Print(cli.SuccessStyle.Render(fmt.Sprintf(" MP4: %s", mp4Path))) + cli.Print("%s", cli.SuccessStyle.Render(fmt.Sprintf(" MP4: %s", mp4Path))) } } @@ -166,19 +166,19 @@ func addSearchCommand(parent *cli.Command) { return nil } - cli.Print(cli.HeaderStyle.Render(fmt.Sprintf("Found %d matches", len(results)))) - cli.Print("") + cli.Print("%s", cli.HeaderStyle.Render(fmt.Sprintf("Found %d matches", len(results)))) + cli.Print("%s", "") for _, r := range results { id := r.SessionID if len(id) > 8 { id = id[:8] } - cli.Print(fmt.Sprintf(" %s %s %s", + cli.Print(" %s %s %s", cli.ValueStyle.Render(id), r.Timestamp.Format("15:04:05"), - cli.DimStyle.Render(r.Tool))) - cli.Print(fmt.Sprintf(" %s", truncateStr(r.Match, 100))) - cli.Print("") + cli.DimStyle.Render(r.Tool)) + cli.Print(" %s", truncateStr(r.Match, 100)) + cli.Print("%s", "") } return nil }, diff --git a/cmd/updater/.github/workflows/ci.yml b/cmd/updater/.github/workflows/ci.yml deleted file mode 100644 index 5d8fadda..00000000 --- a/cmd/updater/.github/workflows/ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.25 - - name: Run Go Generate - run: go generate ./... - - name: Run Tests - run: go test -v -coverprofile=coverage.out ./... - - name: Upload to Codecov - uses: codecov/codecov-action@v2 - with: - files: ./coverage.out - fail_ci_if_error: false diff --git a/cmd/updater/.github/workflows/release.yml b/cmd/updater/.github/workflows/release.yml deleted file mode 100644 index 59ed57a9..00000000 --- a/cmd/updater/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: release -on: - push: - tags: - - 'v*' -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.18 - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}