diff --git a/cmd/review-bot/main.go b/cmd/review-bot/main.go index 85927cf..e967981 100644 --- a/cmd/review-bot/main.go +++ b/cmd/review-bot/main.go @@ -179,9 +179,6 @@ func main() { ghBaseURL = "https://api.github.com" } client = github.NewClient(*reviewerToken, ghBaseURL) - default: - fmt.Fprintf(os.Stderr, "Error: unhandled provider %q\n", *provider) - os.Exit(1) } slog.Info("VCS client initialized", "provider", *provider) @@ -899,7 +896,6 @@ func extractSentinelName(body string) string { return name } - // findAllOwnReviews returns all non-superseded reviews matching the sentinel. func findAllOwnReviews(reviews []vcs.Review, sentinel string) []vcs.Review { var result []vcs.Review diff --git a/cmd/review-bot/main_test.go b/cmd/review-bot/main_test.go index b97c58e..f492b16 100644 --- a/cmd/review-bot/main_test.go +++ b/cmd/review-bot/main_test.go @@ -210,7 +210,6 @@ func TestBuildSupersededBodyShortSHA(t *testing.T) { } } - func TestHasSharedToken(t *testing.T) { tests := []struct { name string @@ -646,8 +645,8 @@ func TestExtractSentinelName_EdgeCases(t *testing.T) { {" rest", "sonnet"}, {" rest", "gpt-review"}, {"no sentinel here", "unknown"}, - {" end", "abc"}, // embedded in text + {" end", "abc"}, // embedded in text } for _, tc := range tests { diff --git a/github/client.go b/github/client.go index 8d41ee7..5ee9d85 100644 --- a/github/client.go +++ b/github/client.go @@ -386,6 +386,7 @@ func (c *Client) doRequestWithBody(ctx context.Context, method, reqURL string, r return c.doRequestCore(ctx, method, reqURL, opts) } + // doJSONRequest performs an HTTP request with a JSON body and returns the response body. // It delegates retry/backoff/429 handling to doRequestWithBody. // This is a general-purpose helper used by any method that needs to send JSON payloads diff --git a/review/persona_test.go b/review/persona_test.go index b90eae7..19a6814 100644 --- a/review/persona_test.go +++ b/review/persona_test.go @@ -355,7 +355,7 @@ func TestCapitalizeFirst(t *testing.T) { {"HELLO", "HELLO"}, {"a", "A"}, {"", ""}, - {"日本語", "日本語"}, // Non-ASCII: Japanese doesn't have case + {"日本語", "日本語"}, // Non-ASCII: Japanese doesn't have case {"über", "Über"}, // German umlaut {"élève", "Élève"}, // French accent }