Repository navigation
refactor(pnpr): source --listen default from Config::DEFAULT_LISTEN - #12629
Conversation
Address CodeRabbit review: instead of duplicating the default listen address as a string literal in the CLI arg, reference the existing Config::DEFAULT_LISTEN constant so the CLI default and the config default cannot drift apart.
📝 WalkthroughWalkthroughThe ChangesCLI listen default update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Summary by Qodopnpr: derive --listen CLI default from Config::DEFAULT_LISTEN Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require review
Previous review resultsReview updated until commit b802245 Results up to commit b802245
Great, no issues found!Qodo reviewed your code and found no material issues that require review
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpr/crates/pnpr/src/main.rs (1)
17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for the
--listendefault/help contract.Line 17 correctly removes duplication, but this user-visible default should be locked by a test that asserts help/default output stays aligned with
Config::DEFAULT_LISTEN(127.0.0.1:7677).As per path instructions, “add/adjust a regression test that would fail without the fix (e.g., asserting the
--listendefault value/help output matchesConfig::DEFAULT_LISTEN)”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpr/crates/pnpr/src/main.rs` at line 17, Add a regression test that locks the `--listen` default/help contract so it stays aligned with `Config::DEFAULT_LISTEN`. Update or add a test around the CLI parsing/help output for `main` and the `Config` default constant to assert the advertised default for `--listen` matches `127.0.0.1:7677`, so the test fails if the help text or default value diverges.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpr/crates/pnpr/src/main.rs`:
- Line 17: Add a regression test that locks the `--listen` default/help contract
so it stays aligned with `Config::DEFAULT_LISTEN`. Update or add a test around
the CLI parsing/help output for `main` and the `Config` default constant to
assert the advertised default for `--listen` matches `127.0.0.1:7677`, so the
test fails if the help text or default value diverges.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: df29393f-33d4-4975-a57c-2376a0e8085b
📒 Files selected for processing (1)
pnpr/crates/pnpr/src/main.rs
|
Code review by qodo was updated up to the latest commit b802245 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12629 +/- ##
=======================================
Coverage 88.18% 88.18%
=======================================
Files 329 329
Lines 47074 47074
=======================================
+ Hits 41511 41513 +2
+ Misses 5563 5561 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Follow-up to the merged #12622 (change pnpr's default port to
7677), addressing a CodeRabbit review comment on that PR.The default listen address was duplicated: a string literal in the
--listenCLI argument (pnpr/crates/pnpr/src/main.rs) and theConfig::DEFAULT_LISTENconstant (pnpr/crates/pnpr/src/config.rs). This points the CLI default at the constant, so the two cannot drift apart — a single source of truth, which is stronger than a regression test guarding the parity.Verified the resolved default is unchanged:
Squash Commit Body
Checklist
Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit