Repository navigation
fix: allow combining --pr-review and its v1 aliases - #547
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Append and aggregate review values cpp-linter/src/cli/mod.rs |
The CLI appends values supplied to the PR-review option and its aliases. FeedbackOptions::is_pr_review returns true when any value is true. The test covers repeated options and aliases with true and false values. |
Use the aggregated review setting cpp-linter/src/cli/structs.rs, cpp-linter/src/run.rs |
ClangParams::from, FeedbackInput::from, and run_main use is_pr_review() in place of direct field checks. Existing conditions remain in place. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Possibly related PRs
- cpp-linter/cpp-linter-rs#535: This PR changes the combined-alias behavior for
--pr-review, which PR#535documents in the migration guide.
Merge Risk: 
Minimal · up to b480c
-
No actionable merge-blocking risk remains in the reviewed change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
2bndy5
left a comment
There was a problem hiding this comment.
Love it when the simplest is the best solution.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #547 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 29 29
Lines 7493 7512 +19
=======================================
+ Hits 7485 7504 +19
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
v1 had separate
--tidy-reviewand--format-reviewoptions, so v1 command lines often pass both, for example--tidy-review=true --format-review=false. In v2 both names are aliases of--pr-review, which usesArgAction::Set, so clap rejects that command line with "cannot be used multiple times".As agreed in #535 (comment),
--pr-reviewnow collects every value (ArgAction::Appendinto aVec<bool>), and reviews are enabled if any of them istrue. The newFeedbackOptions::is_pr_review()resolves the values once;FeedbackInput,ClangParams::gen_patchandrun.rsuse it.-P--tidy-review=true --format-review=false--tidy-review false --format-review false-d -mThe new unit test
pr_review_aliases_can_be_combinedcovers these cases. Ran locally:cargo clippy --all-targetswith and without--features bin, allcpp-linterlib tests, and thereviewsintegration tests (clang 21).Once this is merged, I'll drop the "is rejected in v2" note from the migration guide in #535.
Summary by CodeRabbit
--pr-reviewoptions and aliases. Reviews are enabled when at least one supplied value istrue, so afalsevalue does not override atruevalue elsewhere in the command.