Repository navigation
refactor: comprehensive audit remediation across codebase - #34
Merged
Merged
Conversation
Address 33 findings from codebase audit across maintainability, security, and correctness dimensions. Security: - Support PLEX_TOKEN, JELLYFIN_TOKEN, OVERSEERR_API_KEY env vars for tokens Code Quality: - Rename internal/http -> internal/httputil (avoids net/http shadow) - Eliminate 19 duplicated clr closures -> colors.ClrFunc() helper - Remove ctx from ToolConfig struct, pass context.Context explicitly - Standardize JSONOutput field name across feed and other tools - Add .golangci.yml linter configuration Terminal/UI: - Replace emoji with text alternatives ([MOVIE], [TV], !) - Fix clearScreen() to actually clear terminal - Replace os.Exit(1) with return in watch mode for proper cursor restore - Route 4 diagnostic messages from stdout to stderr Correctness: - Simplify allFailed() switch in streams.go - Add deduplication by ID in feed watch mode event cache - Accept config version >= 1 instead of requiring exactly 1 - Add theme validation with colors.ValidateTheme() - Define constants for magic number label widths in streams.go Testing: - Add 5 cmd/*_test.go files (one per CLI tool, previously untested) - Add httputil/client_test.go with comprehensive HTTP tests - Add colors/colors_test.go with palette and helper tests - Add TokenFromEnv test in config_test.go Build: - Add make fmt target
calmcacil
force-pushed
the
audit-remediation-2026
branch
from
June 1, 2026 10:26
5bd7f95 to
ab6d0da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remediation of 33 findings from a comprehensive codebase audit, spanning security, code quality, correctness, terminal/UI, and testing.
Changes
Security
PLEX_TOKEN,JELLYFIN_TOKEN,OVERSEERR_API_KEYenv vars for API tokensCode Quality
internal/http→internal/httputil(avoidsnet/httpshadow)clrclosures →colors.ClrFunc()helperctxfrom ToolConfig struct, passcontext.ContextexplicitlyJSONOutputfield name across feed and other tools.golangci.ymllinter configurationTerminal/UI
clearScreen()to actually clear terminalos.Exit(1)withreturnin watch mode for proper cursor restoreCorrectness
allFailed()switch in streams.gocolors.ValidateTheme()Testing
go test -race -count=1Build
make fmttargetVerification
go build ./...— passesgo vet ./...— passesgo test -race -count=1 ./...— all 12 packages passgofmt -l .— empty (all formatted)