fix: address review feedback — gofmt NITs and remove unreachable default
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 26s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 47s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m37s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m38s
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 26s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 47s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m37s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m38s
- github/client.go: add missing blank line between doRequestWithBody and doJSONRequest - cmd/review-bot/main.go: remove double blank line before findAllOwnReviews - cmd/review-bot/main.go: remove unreachable default case in VCS client init switch (provider is already validated at startup) - cmd/review-bot/main_test.go: remove double blank line before TestHasSharedToken - cmd/review-bot/main_test.go: fix comment alignment (gofmt) - review/persona_test.go: fix comment alignment in table literal (gofmt)
This commit is contained in:
@@ -179,9 +179,6 @@ func main() {
|
|||||||
ghBaseURL = "https://api.github.com"
|
ghBaseURL = "https://api.github.com"
|
||||||
}
|
}
|
||||||
client = github.NewClient(*reviewerToken, ghBaseURL)
|
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)
|
slog.Info("VCS client initialized", "provider", *provider)
|
||||||
|
|
||||||
@@ -907,7 +904,6 @@ func extractSentinelName(body string) string {
|
|||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// findAllOwnReviews returns all non-superseded reviews matching the sentinel.
|
// findAllOwnReviews returns all non-superseded reviews matching the sentinel.
|
||||||
func findAllOwnReviews(reviews []vcs.Review, sentinel string) []vcs.Review {
|
func findAllOwnReviews(reviews []vcs.Review, sentinel string) []vcs.Review {
|
||||||
var result []vcs.Review
|
var result []vcs.Review
|
||||||
|
|||||||
@@ -210,7 +210,6 @@ func TestBuildSupersededBodyShortSHA(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestHasSharedToken(t *testing.T) {
|
func TestHasSharedToken(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
@@ -692,8 +691,8 @@ func TestExtractSentinelName_EdgeCases(t *testing.T) {
|
|||||||
{"<!-- review-bot:sonnet --> rest", "sonnet"},
|
{"<!-- review-bot:sonnet --> rest", "sonnet"},
|
||||||
{"<!-- review-bot:gpt-review --> rest", "gpt-review"},
|
{"<!-- review-bot:gpt-review --> rest", "gpt-review"},
|
||||||
{"no sentinel here", "unknown"},
|
{"no sentinel here", "unknown"},
|
||||||
{"<!-- review-bot:", "unknown"}, // prefix but no suffix
|
{"<!-- review-bot:", "unknown"}, // prefix but no suffix
|
||||||
{"prefix <!-- review-bot:abc --> end", "abc"}, // embedded in text
|
{"prefix <!-- review-bot:abc --> end", "abc"}, // embedded in text
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
|
|||||||
@@ -386,6 +386,7 @@ func (c *Client) doRequestWithBody(ctx context.Context, method, reqURL string, r
|
|||||||
return c.doRequestCore(ctx, method, reqURL, opts)
|
return c.doRequestCore(ctx, method, reqURL, opts)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// doJSONRequest performs an HTTP request with a JSON body and returns the response body.
|
// doJSONRequest performs an HTTP request with a JSON body and returns the response body.
|
||||||
// It delegates retry/backoff/429 handling to doRequestWithBody.
|
// It delegates retry/backoff/429 handling to doRequestWithBody.
|
||||||
// This is a general-purpose helper used by any method that needs to send JSON payloads
|
// This is a general-purpose helper used by any method that needs to send JSON payloads
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ func TestCapitalizeFirst(t *testing.T) {
|
|||||||
{"HELLO", "HELLO"},
|
{"HELLO", "HELLO"},
|
||||||
{"a", "A"},
|
{"a", "A"},
|
||||||
{"", ""},
|
{"", ""},
|
||||||
{"日本語", "日本語"}, // Non-ASCII: Japanese doesn't have case
|
{"日本語", "日本語"}, // Non-ASCII: Japanese doesn't have case
|
||||||
{"über", "Über"}, // German umlaut
|
{"über", "Über"}, // German umlaut
|
||||||
{"élève", "Élève"}, // French accent
|
{"élève", "Élève"}, // French accent
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user