Adding a skarn completions <shell> subcommand. - #6
Conversation
|
Warning Review limit reached
More reviews will be available in 53 minutes and 51 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 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: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a ChangesShell Completion Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 `@README.md`:
- Around line 84-86: The shell completion install example in README should
create the target directory before redirecting output, since the skarn
completions zsh command will fail on fresh systems if ~/.zfunc is missing.
Update the completion setup instructions to include a directory creation step
before the redirect, keeping the guidance alongside the existing zsh completion
example and the compinit/fpath note.
🪄 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: 047c822e-40f1-445b-a7c4-8824eddbe868
📒 Files selected for processing (4)
README.mdcrates/skarn/Cargo.tomlcrates/skarn/src/commands.rscrates/skarn/src/main.rs
| # 6. (Optional) install shell completion (bash/zsh/fish/powershell): | ||
| # skarn completions zsh > ~/.zfunc/_skarn | ||
| # Then add `fpath+=~/.zfunc` and `compinit` to your .zshrc |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add directory creation before redirecting completion output.
Line 85 can fail on clean setups if ~/.zfunc does not exist.
Suggested doc patch
# 6. (Optional) install shell completion (bash/zsh/fish/powershell):
-# skarn completions zsh > ~/.zfunc/_skarn
-# Then add `fpath+=~/.zfunc` and `compinit` to your .zshrc
+# mkdir -p ~/.zfunc
+# skarn completions zsh > ~/.zfunc/_skarn
+# Then add `fpath=(~/.zfunc $fpath)` and `autoload -Uz compinit && compinit` to your .zshrc📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 6. (Optional) install shell completion (bash/zsh/fish/powershell): | |
| # skarn completions zsh > ~/.zfunc/_skarn | |
| # Then add `fpath+=~/.zfunc` and `compinit` to your .zshrc | |
| # 6. (Optional) install shell completion (bash/zsh/fish/powershell): | |
| # mkdir -p ~/.zfunc | |
| # skarn completions zsh > ~/.zfunc/_skarn | |
| # Then add `fpath=(~/.zfunc $fpath)` and `autoload -Uz compinit && compinit` to your .zshrc |
🤖 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 `@README.md` around lines 84 - 86, The shell completion install example in
README should create the target directory before redirecting output, since the
skarn completions zsh command will fail on fresh systems if ~/.zfunc is missing.
Update the completion setup instructions to include a directory creation step
before the redirect, keeping the guidance alongside the existing zsh completion
example and the compinit/fpath note.
- Remove unused clap::CommandFactory import in main.rs (was failing CI under RUSTFLAGS=-D warnings / clippy -D warnings). - Commit the Cargo.lock entry for clap_complete (was missing). - Collapse the stray double blank line left in the README. - Add smoke tests: validate the CLI definition and that completion scripts generate for every supported shell.
6d00be3 to
f1ecd6d
Compare
# Conflicts: # README.md
|
Merged — thanks for the contribution, @swaploard! 🙏 |
This PR solves (#2). Add skarn completions - a subcommand that prints a shell completion script to stdout, enabling tab-completion for all subcommands and flags.
Summary by CodeRabbit
New Features
completionsCLI subcommand to generate shell completion scripts for supported shells.Documentation
Tests