Skip to content

fix(lint): enable revive nested-structs - #868

Merged
skevetter merged 1 commit into
mainfrom
lint/nested-structs
Aug 3, 2026
Merged

fix(lint): enable revive nested-structs#868
skevetter merged 1 commit into
mainfrom
lint/nested-structs

Conversation

@skevetter

@skevetter skevetter commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracts the anonymous struct nested inside another anonymous struct in pkg/driver/microsandbox/cliclient.go's Find method into a named local type (activeConfig), used only for JSON unmarshaling of the msb inspect CLI output.
  • Enables the nested-structs revive rule in .golangci.yaml.

One rule in the incremental revive rollout — fixed and enabled one rule at a time so main stays green after every merge.

Summary by CodeRabbit

  • Refactor
    • Improved internal configuration parsing for sandbox information while preserving existing label handling and runtime behavior.
  • Quality Improvements
    • Strengthened static analysis checks to promote clearer and more maintainable Go code.
  • Bug Fixes
    • No user-facing bugs or functional changes were introduced.

pkg/driver/microsandbox/cliclient.go's Find declared an anonymous
struct nested inside another anonymous struct for JSON unmarshaling.
Extract the inner struct as a named local type.
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 8b27c01
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a70b63c8bc43600087a914d

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 8b27c01
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a70b63c7265740007786811

@github-actions github-actions Bot added the size/s label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 85dfedbd-e138-412a-87e0-b9f63378d723

📥 Commits

Reviewing files that changed from the base of the PR and between b70487f and 8b27c01.

📒 Files selected for processing (2)
  • .golangci.yaml
  • pkg/driver/microsandbox/cliclient.go

📝 Walkthrough

Walkthrough

The PR enables revive's nested-structs rule and replaces the anonymous active_config struct with a named local activeConfig type. JSON fields and label mapping remain unchanged.

Changes

Nested struct lint compliance

Layer / File(s) Summary
Named active configuration type
.golangci.yaml, pkg/driver/microsandbox/cliclient.go
The linter enables nested-structs. Find uses the named activeConfig type while preserving the existing JSON fields and label mapping.

Estimated code review effort: 1 (Trivial) | ~5 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 and concisely describes enabling the Revive nested-structs lint rule and the related code fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@skevetter
skevetter merged commit 0eeed9a into main Aug 3, 2026
67 checks passed
@skevetter
skevetter deleted the lint/nested-structs branch August 3, 2026 16:34
skevetter added a commit that referenced this pull request Aug 3, 2026
main merged a lint-config change (0eeed9a, #868) enabling
revive.nested-structs while this branch was in flight, so CI's Lint
job — which resolves against main's current tip — flagged the
anonymous struct in jsonRPCResponse.Error that this branch's own
.golangci.yaml doesn't yet know about. Same fix either way: named type,
no behavior change.
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