fix(lint): clear v2 violations in files skipped by other lint PRs#1332
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThree independent sets of changes: filter pipeline functions in Changescmd/ Filter Pipeline Pointer Refactor
purchase: Pointer Params and Spelling Normalization
Cosmetic Test and Doc Housekeeping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Fix the ~45 golangci-lint v2 violations that #1276 deliberately skips because these files are also touched by other open PRs (#1265, #1299). internal/deploy/* is excluded here as #1246 deletes that package. Files fixed and linters addressed: - cmd/helpers_test.go: fieldalignment (govet), unparam - cmd/main_test.go: fieldalignment (govet), also fix positional struct literals broken by field reordering - cmd/multi_service_filters.go: hugeParam + rangeValCopy (gocritic), equalFold (gocritic), godot; all filter functions updated to *Config / *Recommendation params with callers updated across the cmd package - cmd/multi_service_engine_versions_test.go: fieldalignment (govet), godot - internal/auth/service_password_test.go: fieldalignment (govet), godot - internal/auth/store_postgres_test.go: fieldalignment (govet), godot - internal/purchase/approvals.go: err-shadow (govet), misspell (analogue->analog, cancelled->canceled, cancelling->canceling) - internal/purchase/messages.go: hugeParam + rangeValCopy (gocritic), godot, misspell (authorised->authorized) Incidental changes: caller sites in cmd/multi_service{,_helpers,_test, _filters_test}.go; handle*Message signature callers in internal/purchase/{coverage_extra,money_path_regression}_test.go; test assertions updated to match renamed error strings.
cb115d2 to
74f5bd7
Compare
|
Rebased onto current main (post-#1343). Conflict resolution:
12 non-conflicting files ( Gates passed:
New HEAD: 74f5bd7 |
Summary
Clears the ~45 golangci-lint v2 violations that PR #1276 deliberately skips because these 8 files are also touched by other open PRs (#1265, #1299, and feature branches). The
internal/deploy/package is excluded here since PR #1246 deletes it entirely.Linters fixed per file:
cmd/helpers_test.gogovet(fieldalignment),unparamcmd/main_test.gogovet(fieldalignment)cmd/multi_service_filters.gogocritic(hugeParam, rangeValCopy, equalFold),godotcmd/multi_service_engine_versions_test.gogovet(fieldalignment),godotinternal/auth/service_password_test.gogovet(fieldalignment),godotinternal/auth/store_postgres_test.gogovet(fieldalignment),godotinternal/purchase/approvals.gogovet(shadow),misspell(cancelled->canceled, analogue->analog)internal/purchase/messages.gogocritic(hugeParam, rangeValCopy),godot,misspell(authorised->authorized)Incidental changes (required to fix callers of updated signatures):
cmd/multi_service{.go,_helpers.go,_test.go,_filters_test.go}: pass&cfg/&recto updated filter functionsinternal/purchase/{coverage_extra,money_path_regression}_test.go: pass&msgto updatedhandleExecutePurchaseinternal/purchase/approvals_test.go,coverage_extra_test.go: update error-string assertions to match American spellingsNotable fixes:
multi_service_filters.go: all filter functions (applyFilters,shouldInclude*,processRecommendation, etc.) now take*Configand*common.Recommendationto avoid >360-byte copies per call; range loop fixed to use index-based iterationmessages.go:handleApproveMessage/handleCancelMessage/handleExecutePurchasetake*AsyncMessage;gatherApproverContactEmailsuses index-based range to avoid 312-byte copiesapprovals.go: shadow fixed by renaming the innererrtocheckErrin the preflight guard; all British-English variable names and error strings convertedcmd/main_test.go: positional struct literal order corrected after fieldalignment reordered fields (govet was failing)Note: a rebase will be needed when #1265/#1276/#1299 merge, as those PRs touch overlapping files. That is expected and handled separately.
Test plan
go build ./...cleango vet ./...cleangolangci-lint run ./cmd/... ./internal/auth/... ./internal/purchase/...shows 0 violations in the 8 target filesgo test -race ./cmd/...-- 750 tests passgo test -race ./internal/auth/... ./internal/purchase/...-- 760 tests passSummary by CodeRabbit
Bug Fixes
Style
Refactor