Skip to content

fix(mcp): rename cap param to avoid builtin shadow - #985

Merged
skevetter merged 1 commit into
mainfrom
fix/codefactor/mcp-buffer-cap-builtin
Aug 10, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/codefactor/mcp-buffer-cap-builtin

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codefactor fix

  • Codefactor issue: Redefinition of built-in (Maintainability / Minor) — cmd/mcp/buffer.go lines 15 & 17 (parameter cap shadows the Go built-in cap).
  • File:line: cmd/mcp/buffer.go:15

Codefactor message

Redefinition of built-in cap

The NewBoundedBuffer constructor declared its parameter as cap, which redefines the Go built-in cap function and is flagged by Codefactor's Maintainability check. The parameter value is assigned to the struct field b.cap, so the name was a convenience, not a requirement.

Fix

Rename the cap parameter to capacity in NewBoundedBuffer (and update the three references inside the function). The struct field cap is unchanged — it is a field, not a builtin redefinition, and is not flagged. No call site uses a named argument (NewBoundedBuffer(cap: ...)), so the rename is behavior-preserving and API-stable.

Verification

  • task cli:format — clean
  • task cli:lint:ci — 0 new issues (golangci-lint run --new-from-patch)
  • task cli:test — passes; the only failures are the known pre-existing pkg/git TestRepoClone* tests (stale assertion on origin/main, unrelated to this change). The touched package cmd/mcp passes: go test ./cmd/mcp/... → ok.
  • Commit is app-signed by the Devsy GitHub App (committer: web-flow, verified=true).

This PR was created by an AI agent as part of an automated daily Codefactor issue fix job.

@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

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

@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit d0beeac
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a79cdc5f9854700080be56e

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter marked this pull request as ready for review August 10, 2026 16:47
@skevetter
skevetter merged commit e5396b7 into main Aug 10, 2026
67 checks passed
@skevetter
skevetter deleted the fix/codefactor/mcp-buffer-cap-builtin branch August 10, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant