feat: use concrete error types#343
Conversation
when capturing clang tools' output. I expect very low code coverage on this because simulating every little error is tedious or near impossible.
|
Warning Review limit reached
More reviews will be available in 50 minutes and 37 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR replaces generic ChangesError type migration
Clang tool error handling refactor
Clang tools orchestration error typing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@cpp-linter/src/clang_tools/clang_tidy.rs`:
- Around line 303-309: The read error mapping is incorrect: when calling
fs::read_to_string(&file.name) in clang_tidy.rs you should map failures to
ClangCaptureError::ReadFileFailed (not ClangCaptureError::WriteFileFailed);
update the map_err closure that currently constructs WriteFileFailed to
construct ReadFileFailed using the same file_name and source variables so the
error accurately reflects a read failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ab4608e2-229c-4936-af6e-7d518c115b9a
📒 Files selected for processing (6)
clang-tools-manager/src/lib.rscpp-linter/Cargo.tomlcpp-linter/src/clang_tools/clang_format.rscpp-linter/src/clang_tools/clang_tidy.rscpp-linter/src/clang_tools/mod.rscpp-linter/src/error.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
==========================================
- Coverage 91.02% 90.55% -0.48%
==========================================
Files 22 22
Lines 3376 3398 +22
==========================================
+ Hits 3073 3077 +4
- Misses 303 321 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
when capturing clang tools' output.
I also exported some error types from clang-tools-manager crate.
Summary by CodeRabbit
New Features
Refactor
anyhowdependency optional.