Skip to content

refactor(protoc-gen-pony): remove mapValuePonyType duplicate of elemPonyType#49

Merged
enilsen16 merged 2 commits intoTrogonStack:mainfrom
enilsen16:refactor/simplify-protoc-gen-pony
Apr 29, 2026
Merged

refactor(protoc-gen-pony): remove mapValuePonyType duplicate of elemPonyType#49
enilsen16 merged 2 commits intoTrogonStack:mainfrom
enilsen16:refactor/simplify-protoc-gen-pony

Conversation

@enilsen16
Copy link
Copy Markdown
Contributor

Summary

  • mapValuePonyType was identical to elemPonyType in every branch (MessageKind, EnumKind, scalar default). Removed the duplicate and replaced all 4 call sites with elemPonyType.
  • Dropped the redundant doc comment on isWKT — the wktBlocklist var comment directly above it already explains the reasoning in full.

Test plan

  • go test ./cmd/protoc-gen-pony/ — all 36 tests pass (no behavior change)

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 29, 2026

PR Summary

Low Risk
Pure refactor of code-generation helpers with no expected behavior change; limited to type-string construction and comments.

Overview
Simplifies Pony protobuf code generation by removing the duplicated mapValuePonyType helper and switching map value type resolution in decode/type/default emission (emitDecode, emitMapDecodeArm, fieldPonyType, fieldPonyDefault) to reuse elemPonyType.

Also drops a redundant doc comment above isWKT, relying on the existing wktBlocklist comment for explanation.

Reviewed by Cursor Bugbot for commit 49dd0ab. Bugbot is set up for automated code reviews on this repo. Configure here.

…onyType

mapValuePonyType was identical to elemPonyType in every branch.
Replace all 4 call sites and delete the function. Also drop the
redundant isWKT doc comment — wktBlocklist's comment above it
already captures the full reasoning.

Signed-off-by: Erik Nilsen <enilsen16@live.com>
@enilsen16 enilsen16 force-pushed the refactor/simplify-protoc-gen-pony branch from 275de14 to e62e2f8 Compare April 29, 2026 21:51
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Warning

Rate limit exceeded

@enilsen16 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 56 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9dd0974-cc6e-414b-8cd2-7eb18a543314

📥 Commits

Reviewing files that changed from the base of the PR and between 6cc7882 and 49dd0ab.

📒 Files selected for processing (1)
  • cmd/protoc-gen-pony/generate.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 55 minutes and 56 seconds.

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

@enilsen16 enilsen16 merged commit 1669e52 into TrogonStack:main Apr 29, 2026
4 checks passed
@enilsen16 enilsen16 deleted the refactor/simplify-protoc-gen-pony branch April 29, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant