Files
yellowjacket/.planning/quick/13-fix-linting-issues-without-significant-c/13-PLAN.md
T

5.9 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
phase plan type wave depends_on files_modified autonomous must_haves
quick-13 13 execute 1
backend/database/testhelper.go
backend/database/search_test.go
backend/events/cmd/genevents/main.go
backend/library/library.go
backend/library/scan_test.go
backend/config/config_test.go
backend/queue/navigation_test.go
backend/queue/queue_test.go
true
truths artifacts key_links
golangci-lint run ./... reports 0 issues
All existing tests still pass
path provides
backend/database/testhelper.go errcheck fix for db.Close()
path provides
backend/database/search_test.go Remove unused types, fix wsl/golines issues
path provides
backend/events/cmd/genevents/main.go Fix errcheck, nlreturn, wsl issues
path provides
backend/library/library.go Fix gofumpt and wsl issues
path provides
backend/config/config_test.go Fix golines and wsl issues
path provides
backend/queue/navigation_test.go Fix intrange issue
path provides
backend/queue/queue_test.go Fix intrange issue
path provides
backend/library/scan_test.go Fix wsl trailing whitespace
Fix all 31 golangci-lint issues across 8 files. All fixes are mechanical (whitespace, error checking, unused code removal, loop modernization) with zero behavior change.

Purpose: Clean lint output for the codebase. Output: Zero lint issues from golangci-lint.

<execution_context> @/home/caleb/.config/opencode/get-shit-done/workflows/execute-plan.md @/home/caleb/.config/opencode/get-shit-done/templates/summary.md </execution_context>

@.planning/STATE.md Task 1: Fix lint issues in main source files (library.go, genevents/main.go, testhelper.go) backend/library/library.go backend/events/cmd/genevents/main.go backend/database/testhelper.go **backend/database/testhelper.go** (1 errcheck): - Line 66: Change `db.Close()` to `_ = db.Close()` inside the t.Cleanup func

backend/events/cmd/genevents/main.go (10 issues: 4 errcheck, 3 nlreturn, 3+ wsl):

  • Line 35: Add blank line before return
  • Line 61: Add blank line before if err != nil (wsl: only one cuddle assignment before if)
  • Line 85: Add blank line before for i, name := range vs.Names {
  • Line 89: Move bl, ok := ... assignment so it's not cuddled incorrectly — add blank line before it
  • Line 90: Add blank line before if !ok || bl.Kind != token.STRING
  • Line 113: Add blank line before return s
  • Line 129: Add blank line before for _, c := range g.Consts
  • Line 150: Add blank line before if err != nil
  • Line 153: Add blank line before tmpName := tmp.Name()
  • Line 156: Change tmp.Close() to _ = tmp.Close() (errcheck)
  • Line 157: Change os.Remove(tmpName) to _ = os.Remove(tmpName) (errcheck)
  • Line 160: Add blank line before if err := tmp.Close()
  • Line 161: Change os.Remove(tmpName) to _ = os.Remove(tmpName) (errcheck)
  • Line 164: Add blank line before return os.Rename(tmpName, path)

backend/library/library.go (2 issues: 1 gofumpt, 1 wsl):

  • Line 232: Add blank line before workChan := make(...)
  • Line 534-536: Reformat the ScanProgress struct literal so gofumpt is happy — put opening brace on same line as runtime.EventsEmit(l.ctx, events.LibraryScanProgress, and format the struct fields properly (run gofumpt to check exact formatting needed) golangci-lint run ./backend/database/ ./backend/events/... ./backend/library/ 2>&1 | grep -E "errcheck|nlreturn|gofumpt|wsl" | grep -E "testhelper|main.go|library.go" | wc -l should be 0 All errcheck, nlreturn, gofumpt, and wsl issues fixed in the 3 main source files
Task 2: Fix lint issues in test files backend/database/search_test.go backend/config/config_test.go backend/queue/navigation_test.go backend/queue/queue_test.go backend/library/scan_test.go **backend/database/search_test.go** (8 issues: 2 unused, 2 golines, 4 wsl): - Lines 57-65: Remove the unused `artistEntry` and `albumEntry` type definitions entirely - Line 47: Break long track initialization line into multiple lines (golines) - Line 69: Add blank line before `var artistID, albumID int64` - Line 107: Add blank line before `var genreID int64` - Line 371: Add blank line before `for _, r := range results` - Line 435: Add blank line before `for _, r := range results` - Lines 783-784: Add blank line before `t.Fatal(...)` - Lines 788-789: Add blank line before `t.Fatalf(...)`

backend/config/config_test.go (2 issues: 1 golines, 1 wsl):

  • Line 75: Break long t.Errorf line across multiple lines
  • Line 212: Remove trailing blank line before closing }

backend/queue/navigation_test.go (1 intrange):

  • Line 17: Change for i := 0; i < tracks; i++ to for i := range tracks

backend/queue/queue_test.go (1 intrange):

  • Line 56: Change for i := 0; i < count; i++ to for i := range count

backend/library/scan_test.go (1 wsl):

  • Line 659: Remove trailing blank line before closing } golangci-lint run ./... 2>&1 | grep -c "issue" should show "0 issues" and go test ./backend/... should pass All 31 lint issues resolved, golangci-lint reports 0 issues, all tests pass
golangci-lint run ./... 2>&1 — should report 0 issues (excluding deprecation warnings) go test ./backend/... — all tests pass

<success_criteria>

  • golangci-lint run ./... reports 0 issues
  • All existing tests continue to pass
  • No behavioral changes to any code </success_criteria>
After completion, create `.planning/quick/13-fix-linting-issues-without-significant-c/13-SUMMARY.md`