feat: add rust toolchain and shell completions - #5
Conversation
Pin the toolchain via rust-toolchain.toml (1.92.0 with rustfmt and clippy), and add a `self` command group whose `completions` subcommand generates shell completion scripts for bash, zsh, fish, powershell, and elvish via clap_complete.
|
Warning Review limit reached
More reviews will be available in 51 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ 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. 📝 WalkthroughWalkthroughThis PR adds a new ChangesShell Completions Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 `@src/cli.rs`:
- Around line 117-129: The ValueEnum-derived Shell enum currently
lowercases/kebab-cases the PowerShell variant, causing the CLI to expect
"power-shell" instead of "powershell"; fix this by adding an explicit value name
on the PowerShell variant (annotate the PowerShell enum variant so ValueEnum
uses "powershell" as its canonical name), keeping the #[derive(ValueEnum)] on
Shell and leaving other variants unchanged so the completion command accepts
"powershell" as documented.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: ffc6685a-b339-4783-acc0-eb7fa0fa5710
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
Cargo.tomlREADME.mdrust-toolchain.tomlsrc/cli.rssrc/commands/completions.rssrc/commands/mod.rssrc/main.rssrc/telemetry.rs
The derived ValueEnum kebab-cased the variant to "power-shell", which didn't match the documented "powershell". Pin the value name so the CLI accepts "powershell" as shown in the README.
Summary
rust-toolchain.toml(1.92.0 withrustfmtandclippy), matching the setup in skilo.selfcommand group whosecompletionssubcommand prints a shell completion script to stdout, generated withclap_complete.Shell completions
arkouda self completions <shell>supportsbash,zsh,fish,powershell, andelvish:Changes
Cargo.toml: addclap_completedependency.src/cli.rs:selfgroup +SelfCommand::Completions,CompletionsArgs, and aShellvalue enum.src/commands/completions.rs: generate completions to stdout.src/main.rs: dispatch the nestedself completionssubcommand.src/telemetry.rs: map theselfgroup inCommand::name().README.md: document the command and toolchain.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo test --all(28 passing) all clean via the pre-commit hook.arkouda self --helplistscompletionsandarkouda self completions zshemits a valid script.Summary by CodeRabbit
New Features
self completionscommand for bash, zsh, fish, PowerShell, and Elvish shells.Documentation
Chores