chore: clean up lint findings in fork-authored code - #8
Merged
Conversation
golangci-lint on main was reporting 24 issues, all in fork-authored files — CI 'Check' had been failing every run since v1.0.0 integration. Categories: - **unconvert (16)**: internalapi.ModelNameOverride / OriginalModel / RequestModel / ResponseModel are all `type X = string` *aliases*, so the wrapping conversions were no-ops. Removed them from endpointspec, gemini_gcpvertexai, gemini_cachedcontents_gcpvertexai, imageedit_openai_openai, and openai_speech_dashscope. - **gci (2)**: import ordering in endpointspec_test and openai_speech_dashscope. Applied gci --fix. - **testifylint (1)**: `require.Equal(t, "", model)` → `require.Empty(t, model)`. - **gocritic offBy1 (1)**: `after[:strings.Index(after, ":")]` in server_test.go could panic on -1 if the `strings.Contains` guard were removed. Rewrote with `strings.Cut` — safer AND cleaner. - **gosec G602 (1)**: `body[2:eol]` in imageedit_openai_openai's boundary extractor. The preceding `eol < 3` guard makes it safe; annotated with nolint + comment. - **govet shadow (1)**: `if err := ...` inside a function returning `err` in openai_speech_dashscope's ResponseBody. Reused the outer `err`. - **revive unused-parameter (2)**: `original`/`forceBodyMutation` in DashScope RequestBody, `url` in one test's fetcher stub. Renamed to `_` with a comment explaining why (shape always changes → always mutate). No behavior changes. `go build`, `go vet`, and the affected test packages all pass. `golangci-lint run` now reports 0 issues. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughGemini와 Speech 번역기에서 모델 타입 형변환을 제거하고, 관련 엔드포인트·응답 테스트를 갱신했습니다. 이미지 편집 모델 오버라이드와 프로젝트 prefix 모델명 추출 로직도 정리했습니다. Changes모델 타입 전달 및 번역기 정리
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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
golangci-lint on main was reporting 24 issues, all in fork-authored files, and CI 'Check (ubuntu/macos-latest)' had been failing every run since the v1.0.0 integration. This PR takes it to 0 issues without any behavior change.
Fixes
require.Empty)strings.Index → strings.Cut)Verification
go tool -modfile=tools/go.mod golangci-lint run --build-tags==test_crdcel,test_controller,test_extproc,test_e2e ./...→ 0 issuesgo build ./... && go vet ./...✓go test ./internal/translator/... ./internal/endpointspec/... ./internal/extproc/... -count=1✓🤖 Generated with Claude Code
Summary by CodeRabbit