-
Notifications
You must be signed in to change notification settings - Fork 151
chore: replace unused parameter with blank identifier in receiver definitions (st1006) #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…eiver definitions (st1006) https://staticcheck.dev/docs/checks/#ST1006
WalkthroughRefactors method receiver declarations across several engine packages: replaces blank-identifier receivers with unnamed pointer receivers. Affects plan kinds, fetch kinds, and multiple node types, plus a context variable method. No functional logic, return values, or control flow changed; behavior remains the same. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
v2/pkg/engine/resolve/variables.go (1)
84-86
: Optional: apply the same receiver-omission pattern for consistencyFor consistency with this change and to avoid unused receiver names elsewhere in the file, consider omitting receiver names on other methods that don’t use them:
- Line 121: func (o *ObjectVariable) GetVariableKind() VariableKind
- Line 137: func (h *HeaderVariable) GetVariableKind() VariableKind
- Line 178: func (h *ResolvableObjectVariable) GetVariableKind() VariableKind
Example:
- func (*ObjectVariable) GetVariableKind() VariableKind { … }
- func (*HeaderVariable) GetVariableKind() VariableKind { … }
- func (*ResolvableObjectVariable) GetVariableKind() VariableKind { … }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these settings in your CodeRabbit configuration.
📒 Files selected for processing (8)
v2/pkg/engine/plan/plan.go
(2 hunks)v2/pkg/engine/resolve/fetch.go
(4 hunks)v2/pkg/engine/resolve/node_array.go
(2 hunks)v2/pkg/engine/resolve/node_custom.go
(1 hunks)v2/pkg/engine/resolve/node_enum.go
(1 hunks)v2/pkg/engine/resolve/node_object.go
(2 hunks)v2/pkg/engine/resolve/node_scalar.go
(8 hunks)v2/pkg/engine/resolve/variables.go
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (5)
v2/pkg/engine/resolve/node_custom.go (1)
v2/pkg/engine/resolve/node.go (1)
NodeKind
(28-28)
v2/pkg/engine/resolve/node_enum.go (1)
v2/pkg/engine/resolve/node.go (1)
NodeKind
(28-28)
v2/pkg/engine/resolve/node_array.go (1)
v2/pkg/engine/resolve/node.go (3)
NodeKind
(28-28)Node
(20-26)NodeKindEmptyArray
(7-7)
v2/pkg/engine/resolve/node_scalar.go (1)
v2/pkg/engine/resolve/node.go (3)
NodeKind
(28-28)NodeKindNull
(8-8)Node
(20-26)
v2/pkg/engine/resolve/node_object.go (1)
v2/pkg/engine/resolve/node.go (3)
NodeKind
(28-28)NodeKindEmptyObject
(5-5)Node
(20-26)
🔇 Additional comments (9)
v2/pkg/engine/resolve/variables.go (1)
84-86
: ST1006 compliance: good move to an unnamed receiverOmitting the unused receiver name is correct and aligns with Staticcheck ST1006. No behavior change.
v2/pkg/engine/plan/plan.go (2)
28-30
: Receiver cleanup aligns with ST1006Switching from (_ *SynchronousResponsePlan) to (*SynchronousResponsePlan) is correct and keeps the receiver unnamed where unused. No functional impact.
41-43
: Receiver cleanup aligns with ST1006Same here for SubscriptionResponsePlan. Looks good; no behavior change.
v2/pkg/engine/resolve/fetch.go (3)
155-157
: Conforms to ST1006: unnamed receiverUsing an unnamed receiver on SingleFetch.FetchKind is correct. No change in behavior.
203-205
: Conforms to ST1006: unnamed receiverBatchEntityFetch.FetchKind updated appropriately. No functional changes.
242-244
: Conforms to ST1006: unnamed receiverEntityFetch.FetchKind updated appropriately. Behavior unchanged.
v2/pkg/engine/resolve/node_enum.go (1)
14-16
: ST1006-compliant receiver changeGood switch to an unnamed receiver on Enum.NodeKind. Maintains behavior and improves style.
v2/pkg/engine/resolve/node_custom.go (1)
17-19
: ST1006-compliant receiver changeCorrectly removes the unused receiver name on CustomNode.NodeKind. No functional impact.
v2/pkg/engine/resolve/node_array.go (1)
23-25
: Ignore — unnamed method receivers are valid Go; do not apply these diffsGo permits omitting the receiver identifier (e.g.,
func (*T) M()
), and your ripgrep output shows many such occurrences (including generated protobufs). The suggested diffs are unnecessary — only considerfunc (_ *T) ...
for handwritten code if you want a linter preference; do not change generated files.Examples from your search:
- v2/pkg/engine/resolve/node_array.go (original location)
- v2/pkg/grpctest/productv1/product.pb.go (many generated methods)
- v2/pkg/engine/plan/plan.go
- v2/pkg/engine/resolve/node_object.go
- v2/pkg/engine/resolve/node_scalar.go
Likely an incorrect or invalid review comment.
I am not sure about this rule |
https://staticcheck.dev/docs/checks/#ST1006
Summary by CodeRabbit
Notes