Skip to content

fix(lint): resolve all funcorder findings - #873

Merged
skevetter merged 2 commits into
mainfrom
lint/funcorder-stdio-listener
Aug 3, 2026
Merged

fix(lint): resolve all funcorder findings#873
skevetter merged 2 commits into
mainfrom
lint/funcorder-stdio-listener

Conversation

@skevetter

@skevetter skevetter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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, unlike revive'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):

  • Constructors (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.
  • Unexported helper methods moved to after the last exported method on the same struct: pkg/agent/tunnelserver, pkg/apple, pkg/client/clientimplementation, cmd/pro/provider/watch + pkg/daemon/platform (both have an instanceStore.key method), pkg/dockerfile, pkg/driver/kubernetes, pkg/ide/jetbrains, pkg/ide/openvscode, pkg/platform/client, pkg/platform/remotecommand.
  • pkg/types/time.go's NewTime constructor moved before DeepCopyInto (this file mirrors upstream Kubernetes apimachinery code, so the reorder keeps it Kubernetes-convention-adjacent while still satisfying funcorder).

No .golangci.yaml change needed -- funcorder was already fully active.

Summary by CodeRabbit

  • Refactor
    • Reorganized internal code declarations across workspace, tunneling, platform, IDE, container, and networking components.
    • No user-facing functionality, APIs, performance, or runtime behavior changed.

…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.
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 782efad
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a70ddf3cb43290008183cb5

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 782efad
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a70ddf3cb11000008ad67b4

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@skevetter, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 908ab6f0-0418-4a2b-983c-6574219170b0

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5154b and 782efad.

📒 Files selected for processing (2)
  • pkg/dockerfile/parse.go
  • pkg/ide/openvscode/openvscode.go
📝 Walkthrough

Walkthrough

The pull request reorders existing declarations and helper methods across multiple Go packages. Implementations, signatures, fields, error handling, and runtime behavior remain unchanged.

Changes

Declaration ordering cleanup

Layer / File(s) Summary
Type and constructor declaration ordering
pkg/ide/fleet/fleet.go, pkg/ide/openvscode/openvscode.go, pkg/ide/rstudio/rstudio.go, pkg/platform/remotecommand/stream.go, pkg/stdio/listener.go, pkg/types/time.go
Existing types, constructors, and methods were reordered within their files.
Helper and client method ordering
cmd/pro/provider/watch/workspaces.go, pkg/agent/tunnelserver/logger.go, pkg/apple/helper.go, pkg/client/clientimplementation/proxy_client.go, pkg/daemon/platform/workspace_watcher.go, pkg/driver/kubernetes/driver.go, pkg/ide/jetbrains/generic.go, pkg/platform/client/client.go, pkg/platform/remotecommand/websocket.go
Existing private helpers and client methods were moved to different locations without implementation changes.
Dockerfile parser declaration ordering
pkg/dockerfile/parse.go
Parser types, utility functions, and Parse were relocated without changing behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the lint-related change and specifically states that all funcorder findings are resolved.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.
@skevetter
skevetter merged commit 01e2a98 into main Aug 3, 2026
67 checks passed
@skevetter
skevetter deleted the lint/funcorder-stdio-listener branch August 3, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant