Skip to content

fix: allow combining --pr-review and its v1 aliases - #547

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-a3krfd-pr-review
Nov 2, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-a3krfd-pr-review

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

v1 had separate --tidy-review and --format-review options, 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 uses ArgAction::Set, so clap rejects that command line with "cannot be used multiple times".

As agreed in #535 (comment), --pr-review now collects every value (ArgAction::Append into a Vec<bool>), and reviews are enabled if any of them is true. The new FeedbackOptions::is_pr_review() resolves the values once; FeedbackInput, ClangParams::gen_patch and run.rs use it.

args enabled
(none) false
-P true
--tidy-review=true --format-review=false true
--tidy-review false --format-review false false
-d -m true

The new unit test pr_review_aliases_can_be_combined covers these cases. Ran locally: cargo clippy --all-targets with and without --features bin, all cpp-linter lib tests, and the reviews integration 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

  • New Features
    • PR review settings now accept repeated --pr-review options and aliases. Reviews are enabled when at least one supplied value is true, so a false value does not override a true value elsewhere in the command.
    • The combined setting is applied consistently when handling review requests, including local-execution warnings and changed-file metadata.

@shenxianpeng
shenxianpeng requested a review from 2bndy5 November 2, 2026 09:05
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21ab52ea-f7a2-4ea7-94cd-a3f60728d3d6
Commits

Reviewing files that changed from the base of the PR and between 1fffa0b and b480c36.

Files selected for processing: 3
  • cpp-linter/src/cli/mod.rs
  • cpp-linter/src/cli/structs.rs
  • cpp-linter/src/run.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The PR-review CLI option and its aliases now accept repeated boolean values. Review activation uses the combined values: it is enabled when any supplied value is true. CLI conversions and runtime checks use this result.

Changes: PR-review option handling

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 #535 documents in the migration guide.
Merge Risk: Minimal · up to b480c

No actionable merge-blocking risk remains in the reviewed change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: allowing --pr-review and its v1 aliases to be combined.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full 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.

Share

@2bndy5 2bndy5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it when the simplest is the best solution.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (1fffa0b) to head (b480c36).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shenxianpeng
shenxianpeng merged commit 905e625 into main Nov 2, 2026
81 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-a3krfd-pr-review branch November 2, 2026 14:38
@shenxianpeng shenxianpeng added the bug Something isn't working label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants