Add permission display modes#138
Conversation
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
|
Warning Review limit reached
More reviews will be available in 45 minutes and 38 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 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 review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. 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 (7)
📝 WalkthroughWalkthroughAdds a ChangesPermission Display Mode Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 15 |
| Duplication | -28 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/lib.rs (1)
14-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid promoting
PermissionDisplayto the crate root.This enum looks like internal CLI/config wiring, and re-exporting it here makes it part of the most visible public surface. Given this crate is treated as the
lspapplication rather than a supported library API, I’d keep new types like this off the root export list unless an external consumer genuinely needs them. Based on learnings, prefer tighter visibility for app-internal types.🤖 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 `@src/lib.rs` around lines 14 - 16, The crate root export list in src/lib.rs is exposing PermissionDisplay unnecessarily, which widens the public surface for an app-internal type. Remove PermissionDisplay from the pub use structs::{...} re-export in src/lib.rs, and keep the remaining root exports limited to the types intended for external use.Source: Learnings
src/cli.rs (1)
425-431: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake
PermissionDisplaythe single source of truth for CLI values.The four mode strings are now duplicated in the Clap definition and again in the manual
match, on top of the Serde naming on the enum itself. Deriving the enum for Clap and readingget_one::<PermissionDisplay>()directly would remove this drift point before the next mode change.Also applies to: 509-517
🤖 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 `@src/cli.rs` around lines 425 - 431, The permission mode strings are duplicated between the Clap argument setup in permissions_arg and the manual parsing logic that matches CLI values, so make PermissionDisplay the single source of truth. Derive or otherwise integrate PermissionDisplay with Clap so the CLI can parse it directly, then update the argument builder and the downstream match logic to read get_one::<PermissionDisplay>() instead of hardcoding string lists or re-mapping them manually.
🤖 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.
Nitpick comments:
In `@src/cli.rs`:
- Around line 425-431: The permission mode strings are duplicated between the
Clap argument setup in permissions_arg and the manual parsing logic that matches
CLI values, so make PermissionDisplay the single source of truth. Derive or
otherwise integrate PermissionDisplay with Clap so the CLI can parse it
directly, then update the argument builder and the downstream match logic to
read get_one::<PermissionDisplay>() instead of hardcoding string lists or
re-mapping them manually.
In `@src/lib.rs`:
- Around line 14-16: The crate root export list in src/lib.rs is exposing
PermissionDisplay unnecessarily, which widens the public surface for an
app-internal type. Remove PermissionDisplay from the pub use structs::{...}
re-export in src/lib.rs, and keep the remaining root exports limited to the
types intended for external use.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a57b56bc-f51c-4387-9a69-78b80fb53a4b
📒 Files selected for processing (18)
README.mddocs/src/config.mddocs/src/usage.mdsrc/cli.rssrc/lib.rssrc/structs.rssrc/utils/file.rssrc/utils/format.rssrc/utils/render.rstests/crate/app.rstests/crate/cli.rstests/crate/file.rstests/crate/render.rstests/crate/settings.rstests/format.rstests/integration.rstests/seams.rstests/structs.rs
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
Adds a long-format permissions option with symbolic, octal, both, and none modes. Includes config support, octal rendering and coloring, tests, README notes, and mdBook usage/config documentation.
Summary by CodeRabbit
New Features
--permissionsoption for long-format output, letting you choose symbolic, octal, both, or no permissions display.Bug Fixes
Documentation