WIP: cmd_doctor returns Result<i32> but never fails#617
WIP: cmd_doctor returns Result<i32> but never fails#617EffortlessSteven wants to merge 4 commits intomainfrom
Conversation
- safe_slice: document bounds clamping guarantees that make direct indexing valid - byte_to_column: document byte index to column conversion and why direct slicing is safe
Work item: work-7bd76a04
Work item: work-7ef3eee3
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 52 minutes and 32 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 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 |
Property Test ResultsAll property tests passed. Properties Tested (5 total, 173+ iterations):
No counterexamples found. |
Snapshot Test Findings — work-7ef3eee3What This Change DoesThe implementation changes Snapshots Written
For each snapshot:
Edge Cases Covered
Non-Deterministic Output HandlingGit version strings are normalized using Summary
|
Integration Test Findings — work-7ef3eee3What This Change DoesChanges Integration Tests Written18 tests across 4 test files:
Component Handoffs Tested
Error PropagationErrors handled internally within CLI Flow
Test Status
Key FindingImplementation not yet applied — 4 tests fail because they verify
Snapshot tests pass, confirming CLI behavior is correct regardless of return type change. Integration test agent |
The assert! macro calls had trailing start+1, end+1 args but the
format strings had no {} placeholders. This causes compilation under
-D warnings. Remove the unused args.
Note: 6 tests still fail at runtime because diffguard.toml.example
doesn't yet document tags/test_cases for rust.no_unwrap (work-d4a75f70).
Closes #412
Summary
Fix
clippy::unnecessary_wrapspedantic lint oncmd_doctorby changing its return type fromResult<i32>toi32.ADR
Specs
What Changed
Modified
crates/diffguard/src/main.rs:cmd_doctorfunction signature fromfn cmd_doctor(args: DoctorArgs) -> Result<i32>tofn cmd_doctor(args: DoctorArgs) -> i32if all_pass { Ok(0) } else { Ok(1) }toif all_pass { 0 } else { 1 }Ok(...)to maintain type compatibilityTest Results (so far)
No test output available due to pre-existing compilation errors in
crates/diffguard-domain/src/preprocess.rs(unrelated to this issue).Friction Encountered
None - implementation was straightforward per ADR-0012 specifications.
Notes
unnecessary_wraps(plural), notunnecessary_wrap(singular)