Skip to content

deprecate: replace --tidy-review/--format-review with --pr-review - #377

Merged
2bndy5 merged 2 commits into
mainfrom
deprecate-review-args
Jun 20, 2026
Merged

2bndy5 merged 2 commits into
mainfrom
deprecate-review-args

Conversation

@2bndy5

@2bndy5 2bndy5 commented Jun 20, 2026 •

Copy link
Copy Markdown
Collaborator
  • add --pr-review to control posting PR reviews
  • make --tidy-review/--format-review aliases of --pr-review for backward compatibility

resolves #375

Summary by CodeRabbit

  • Refactor
    • Consolidated PR review configuration into a single unified --pr-review flag, replacing separate review toggles for better user clarity and simpler command-line setup.
    • Legacy --tidy-review and --format-review flags remain available as backward-compatible aliases to ensure existing workflows continue without interruption.

- add `--pr-review` to control posting PR reviews
- make `--tidy-review`/`--format-review` aliases of `--pr-review` for backward compatibility

resolves #375
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@2bndy5, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 53 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2edc645c-04cc-4af8-be04-5d5f03ada107

📥 Commits

Reviewing files that changed from the base of the PR and between abe9577 and d7814d9.

📒 Files selected for processing (1)
  • cpp-linter/src/cli/mod.rs
📝 Walkthrough

Walkthrough

Two separate CLI flags (--tidy-review/-d and --format-review/-m) controlling PR review posting are replaced by a single --pr-review/-P flag with backward-compatible aliases. The corresponding tidy_review and format_review fields are removed from ClangParams, FeedbackOptions, and FeedbackInput, replaced by a single pr_review: bool. Runtime consumers in run.rs and rest_client.rs are updated to reference the new field, and tests are adjusted accordingly.

Changes

PR Review Flag Unification

Layer / File(s) Summary
CLI flag and struct contract changes
cpp-linter/src/cli/mod.rs, cpp-linter/src/cli/structs.rs
FeedbackOptions replaces tidy_review/format_review with a single pr_review bool (-P/--pr-review) with aliases format-review and tidy-review. ClangParams removes both fields and their construction assignments. FeedbackInput replaces both fields with pr_review in its definition, From<&Cli> impl, and Default impl.
Runtime flag consumption
cpp-linter/src/run.rs, cpp-linter/src/rest_client.rs
run.rs switches the changed-files fetch condition to check cli.feedback_options.pr_review, makes clang_params immutable, and removes the AND-with-is_pr mutation of the now-deleted fields. rest_client.rs narrows the PR review trigger from tidy_review || format_review to pr_review.
Test updates
cpp-linter/tests/reviews.rs, cpp-linter/src/clang_tools/clang_tidy.rs
TestParams replaces tidy_review/format_review with pr_review (defaults to true), setup() condition and run_main arg wiring are updated to use --pr-review, the two tool-specific-only test cases are removed, and the use_extra_args test removes the deleted fields from its ClangParams literal.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: deprecating two separate CLI flags and consolidating them into a single unified flag.
Linked Issues check ✅ Passed All coding objectives from issue #375 are met: a new --pr-review flag was added, old flags are maintained as aliases for backward compatibility, and the unified logic replaces separate review controls.
Out of Scope Changes check ✅ Passed All changes are directly related to consolidating review control options. No unrelated modifications were introduced outside the scope of issue #375.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.41%. Comparing base (f352be2) to head (d7814d9).
⚠️ Report is 76 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #377      +/-   ##
==========================================
- Coverage   92.43%   92.41%   -0.02%     
==========================================
  Files          23       23              
  Lines        3646     3637       -9     
==========================================
- Hits         3370     3361       -9     
  Misses        276      276              

☔ 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.

@2bndy5
2bndy5 marked this pull request as ready for review June 20, 2026 18:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cpp-linter/tests/reviews.rs (1)

218-231: ⚡ Quick win

Add explicit tests for deprecated --tidy-review / --format-review aliases.

The suite now validates only --pr-review, so backward-compatibility paths for legacy flags are untested. Adding a small pair of alias-driven cases would prevent regressions in the deprecation path.

🤖 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 `@cpp-linter/tests/reviews.rs` around lines 218 - 231, The test suite in
reviews.rs only validates the new --pr-review flag but does not test the
deprecated --tidy-review and --format-review aliases, leaving
backward-compatibility paths untested. Add two additional test cases that use
the deprecated --tidy-review and --format-review flags respectively (either
replacing or alongside --pr-review in the args vector construction) to ensure
these legacy flags continue to work correctly and prevent regressions in the
deprecation path.
🤖 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/cli/mod.rs`:
- Around line 509-521: The pr_review field in the CLI argument configuration has
removed the short form flags (-d and -m), breaking backward compatibility for
existing scripts and workflows. To fix this, add support for the deprecated
short form flags in the pr_review argument definition. Update the aliases
configuration or add an additional short-form mapping mechanism to maintain
backward compatibility with the legacy -d and -m short flags that were
previously supported, while keeping the existing long form aliases
(format-review, tidy-review) intact.

---

Nitpick comments:
In `@cpp-linter/tests/reviews.rs`:
- Around line 218-231: The test suite in reviews.rs only validates the new
--pr-review flag but does not test the deprecated --tidy-review and
--format-review aliases, leaving backward-compatibility paths untested. Add two
additional test cases that use the deprecated --tidy-review and --format-review
flags respectively (either replacing or alongside --pr-review in the args vector
construction) to ensure these legacy flags continue to work correctly and
prevent regressions in the deprecation path.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2c11ffd3-6577-4a80-b007-ec7ffee8dc81

📥 Commits

Reviewing files that changed from the base of the PR and between f352be2 and abe9577.

📒 Files selected for processing (6)
  • cpp-linter/src/clang_tools/clang_tidy.rs
  • cpp-linter/src/cli/mod.rs
  • cpp-linter/src/cli/structs.rs
  • cpp-linter/src/rest_client.rs
  • cpp-linter/src/run.rs
  • cpp-linter/tests/reviews.rs
💤 Files with no reviewable changes (1)
  • cpp-linter/src/clang_tools/clang_tidy.rs

Comment thread cpp-linter/src/cli/mod.rs
@2bndy5
2bndy5 merged commit fc75245 into main Jun 20, 2026
73 checks passed
@2bndy5
2bndy5 deleted the deprecate-review-args branch June 20, 2026 19:52
2bndy5 added a commit that referenced this pull request Oct 6, 2026
…ds (#464)

Part of aligning the READMEs across the org (same layout as
cpp-linter/cpp-linter-hooks#289). Every install command was run today.

## Install commands

| Command | Today | Now |
|---|---|---|
| `cargo install cpp-linter --features bin` | fails: no version matches
`*`. Any range picks `2.0.0-rc9` (semver sorts it after `rc.23`), which
has no `bin` feature | `--version 2.0.0-rc.23` |
| `cargo binstall cpp-linter` | fails the same way | `--version
2.0.0-rc.23` |
| `pip install cpp-linter` | installs the Python package 1.14.1 | the
README says so; TestPyPI needs `--pre` (fails without it on pip 26.2.1
and 25.2) |
| `npm install @cpp-linter/cpp-linter` | fails: `latest` is the
deprecated rc2 | `@cpp-linter/cpp-linter@next` (rc.21) |

The `rc.23` pin has to be bumped by hand at each crate release, since
`bump-n-release.nu` does not touch READMEs.

## README.md

- **Header:**
  - The H1 is `cpp-linter-rs`.
- Badges: v2 release candidate, ci (`run-dev-tests.yml`), coverage, part
of cpp-linter. The five build badges are gone.
  - The checklist becomes one sentence with the same words and links.
  - A link line follows.
- **Warning:** the website's wording, "in release candidates; use the
Python package until 2.0 is released", instead of "experimental".
- **Badges further down:**
  - TestPyPI and npm `next` stay, in the same colors.
- crates.io, PyPI and docs.rs are gone; they showed rc9, 1.14.1 or the
wrong version.
- **Example:** it used the removed `--tidy-review`/`--format-review`
links. It now uses `--pr-review` (#377), and all 7 images load.
- **Sections:** `## Install` becomes `## Quick start`, with the content
unchanged. "Have question or feedback?" becomes `## Contributing` and
links CONTRIBUTING.md.

## Package READMEs

- **All three:** a link line is added, and the `cli.html` links (404)
now point to `/cli/`.
- **`cpp-linter/README.md` (crates.io):** typos and "Github" spellings
are fixed. The CHANGELOG badge is removed; restore it if you want it on
crates.io.
- **`bindings/python/README.md`:** the TestPyPI command gets `--pre`,
and `cpp-linter -help` becomes `--help`.
- **`bindings/node/README.md`:** the install command uses `@next`.

## docs/docs/index.md

The `[tidy-review]` and `[format-review]` definitions become
`[pr-review]`. Without this the docs home page would print
`[--pr-review][pr-review]` as text.

## Checked

- `readme_renderer` passes for the Python binding README.
- pre-commit, including cspell, passes.
- All links return 200 (npmjs.com answers scripts with 403).
- The docs build runs on this PR.

## Outside this PR

- **npm `latest`:** it still points to the deprecated rc2. An npm owner
can run `npm dist-tag add @cpp-linter/cpp-linter@2.0.0-rc.21 latest`.
- **crates.io:** it shows rc9's README until 2.0 is out, or until rc1 to
rc15 are yanked. Yanking would also let a version range pick the newest
rc.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated project guides with links to the website, documentation,
getting-started resources, and discussions.
* Added v2 release-candidate quick-start instructions for Rust, Node.js,
and Python, including pre-release installation details and a note about
the standard PyPI package.
* Updated pull-request review guidance to use `--pr-review` and
refreshed CLI documentation links.
* Updated project descriptions and badge links, and removed select
badges.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Brendan <2bndy5@gmail.com>
2bndy5 pushed a commit that referenced this pull request Oct 18, 2026
…avior (#503)

<!-- claude-projects-attribution: {"github_login":"shenxianpeng"} -->

## Summary

Docs/code consistency pass of the v2 docs against the clap definitions
and current behavior.

`docs/cli.yml` (version and permission badges, looked up by each
option's long name):
- `extra-args` never matched: the option is `--extra-arg`. Renamed the
key.
- `tidy-review` / `format-review` are now only aliases of `--pr-review`
(#377), so `--pr-review` had no version or permission badge. Replaced
both with a `pr-review` entry (`pull-requests: write`).
- `--mod-sys` / `--no-mod-sys` had no entries; added them.

`docs/docs/pr-review-caveats.md`:
- The collapsed patch in the review summary only holds the suggestions
that did not fit in the diff (`common_fs.rs`), and it is left out when
it is too large for a comment (`clang_tools/mod.rs`). The docs said the
full patch is always included.
- Added that suggestions already posted in an earlier review are not
repeated, and no new review is posted when all of them were
(`rest_client.rs`).

## Related Issues

None.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated CLI guidance for system-module options and the singular
`extra-arg` setting.
* Consolidated pull-request review configuration under `pr-review`,
replacing the separate tidy and format review entries.
* Clarified that previously posted suggestions aren’t repeated and that
no new review is posted when all suggestions have already been shared.
* Updated guidance for suggestions outside the pull-request diff: the
summary comment includes a collapsible patch when it fits.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deprecate separate review options

1 participant