fix(lint): resolve all funcorder findings - #873
Conversation
…order) funcorder's constructor and struct-method checks are on by default once the linter is enabled -- no separate settings toggle exists. Fixes all 26 pre-existing violations: unexported methods placed before an exported method on the same struct, and constructors placed after their struct declaration. Pure reordering, no logic changes.
✅ Deploy Preview for images-devsy-sh canceled.
|
✅ Deploy Preview for devsydev canceled.
|
|
Warning Review limit reached
Next review available in: 49 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request reorders existing declarations and helper methods across multiple Go packages. Implementations, signatures, fields, error handling, and runtime behavior remain unchanged. ChangesDeclaration ordering cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
CI's only-new-issues flagged these because the funcorder reorder touched their lines, but both predate this PR: - pkg/dockerfile/parse.go: expandVariables and resolveVariable each carried an unused trailing int parameter (a vestigial compatibility placeholder), pushing them to 5 args. Removed it and updated all call sites; two of them were passing a real value that was always discarded. - pkg/ide/openvscode/openvscode.go: two exec.Command(args[0], args[1:]...) calls build args from a fixed "su"/"sh" shell and an internally constructed command string, not external input -- same trust level already accepted for the equivalent pattern in pkg/ssh/server/ssh.go. Suppressed with the same //nolint:gosec convention used there.
Summary
funcorder's constructor/struct-method checks are on by default once the linter is enabled in
.golangci.yaml-- there's no separate opt-in setting, unlikerevive's per-rule sub-settings used in the other PRs in this series. All 26 pre-existing findings are fixed here in one PR since none of them were gated behind a config toggle.Two kinds of fix, both pure reordering with no logic changes (diff is exactly balanced: 371 insertions / 371 deletions):
NewX) moved to immediately after their struct's declaration, in files where the constructor appeared first:pkg/ide/fleet,pkg/ide/openvscode,pkg/ide/rstudio,pkg/platform/remotecommand(stream.go, websocket.go),pkg/stdio.pkg/agent/tunnelserver,pkg/apple,pkg/client/clientimplementation,cmd/pro/provider/watch+pkg/daemon/platform(both have aninstanceStore.keymethod),pkg/dockerfile,pkg/driver/kubernetes,pkg/ide/jetbrains,pkg/ide/openvscode,pkg/platform/client,pkg/platform/remotecommand.pkg/types/time.go'sNewTimeconstructor moved beforeDeepCopyInto(this file mirrors upstream Kubernetesapimachinerycode, so the reorder keeps it Kubernetes-convention-adjacent while still satisfying funcorder).No
.golangci.yamlchange needed --funcorderwas already fully active.Summary by CodeRabbit