chore: dedupe imports and simplify expressions - #1780
Conversation
Remove double imports of the same package and replace expressions with their shorter defined-equivalent forms. No behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes standardize Cobra command aliases, simplify core and persistence metadata handling, adjust onboarding transaction ID input, and update related test setup and expectations. ChangesRepository cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 29808915020Coverage decreased (-0.004%) to 46.197%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Summary
Mechanical cleanups with no behavior change: remove duplicate imports and replace expressions with their shorter defined-equivalent forms.
Changes
cmd/preferences.go,cmd/root.go,cmd/server.go: cobra was imported twice (bare and ascli) and both names were used in the same file. Keep theclialias, which the rest of the package uses.internal/api/v1beta1connect/policy_test.go: the mocks package was imported under two names; keepmocks.billing/credit/service_test.go:errors.New(fmt.Sprintf(...))→fmt.Errorf(...)(same message,%vkept so wrapping semantics stay unchanged)core/event/service.go: drop afmt.Sprintf("%s", s)on a value that is already a stringcore/relation/service.go: the ID regex uses a raw string, removing the double escapinginternal/api/v1beta1connect/permission_test.go: copy loop →append(dst, src...)internal/api/v1beta1connect/prospect.go: merge a variable declaration with its assignmentinternal/store/postgres/null_converters.go,organization_repository.go: drop nil checks that duplicate whatlenandrangealready define for nil mapsTest Plan
SQL Safety (if your PR touches
*_repository.goorgoqu.*)?placeholders,goqu.Ex{}, orgoqu.Record{}— neverfmt.Sprintfor+building a query that gets executed.ToSQL()callers capture and forward params (query, params, err := stmt.ToSQL(); db.…Context(ctx, …, query, params...)). Neverquery, _, err := ….?placeholders inside single-quoted SQL literals ingoqu.L(usemake_interval(hours => ?)-style functions instead).//nolint:forbidigoor// #nosec G20xannotation has a one-line justification on the same line that a reviewer can verify.