feat(cli): add shell completion for bash, zsh, fish, and PowerShell#100
feat(cli): add shell completion for bash, zsh, fish, and PowerShell#100ruivieira merged 5 commits intoeval-hub:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new Changes
Sequence Diagram(s)mermaid mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
… 1.19.1 Replace the non-functional hardcoded PowerShell completion script with a proper Click ShellComplete subclass (PowerShellComplete) registered via add_completion_class. This fixes the missing _EVALHUB_COMPLETE handler and the $cursorPosition/COMP_CWORD semantic mismatch. Also upgrade mypy from 1.7.1 to 1.19.1 across pyproject.toml, pre-commit, and CI workflows.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pyproject.toml (1)
75-75: Inconsistent version constraints for mypy.Line 75 pins mypy exactly with
==1.19.1, while Line 202 uses a minimum constraint>=1.19.1. This inconsistency can cause:
- Different mypy versions being installed depending on which dependency path is resolved
- Potential conflicts if the
>=constraint resolves to a newer version with breaking changesConsider using the same constraint style in both locations for consistency.
♻️ Proposed fix to use consistent pinning
[dependency-groups] dev = [ "eval-hub-server @ git+https://github.com/eval-hub/eval-hub#subdirectory=python-server", # TODO: this should be moved to a pypi release "fastapi>=0.124.4", "httpx>=0.28.1", - "mypy>=1.19.1", + "mypy==1.19.1", "olot>=0.1.15",Also applies to: 202-202
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` at line 75, The mypy version constraint is inconsistent: one dependency entry pins "mypy==1.19.1" while another uses "mypy>=1.19.1"; pick a single constraint style and make both entries match (either change the "mypy==1.19.1" entry to "mypy>=1.19.1" or change the "mypy>=1.19.1" entry to "mypy==1.19.1") so that all occurrences of the mypy dependency in pyproject.toml use the same version specifier, updating both the exact "mypy==1.19.1" token and the "mypy>=1.19.1" token to the chosen form.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pyproject.toml`:
- Line 75: The mypy version constraint is inconsistent: one dependency entry
pins "mypy==1.19.1" while another uses "mypy>=1.19.1"; pick a single constraint
style and make both entries match (either change the "mypy==1.19.1" entry to
"mypy>=1.19.1" or change the "mypy>=1.19.1" entry to "mypy==1.19.1") so that all
occurrences of the mypy dependency in pyproject.toml use the same version
specifier, updating both the exact "mypy==1.19.1" token and the "mypy>=1.19.1"
token to the chosen form.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4a06e4be-0132-4dd2-b196-311bd589b922
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.github/workflows/pre-commit.yml.pre-commit-config.yamlpyproject.tomlsrc/evalhub/adapter/callbacks.pysrc/evalhub/cli/completion.pytests/unit/test_cli_completion.py
✅ Files skipped from review due to trivial changes (2)
- .pre-commit-config.yaml
- .github/workflows/pre-commit.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- src/evalhub/cli/completion.py
tarilabs
left a comment
There was a problem hiding this comment.
LGTM for as far as I can see
I have 2 main doubts:
- Powershell is an append, so how does an update work for them?
- is there a way to provide a mechanism to the user to get informed when they need to refresh the completions? (ie new/changed commands?)
…pending to $PROFILE
@tarilabs thanks for the review. I've changed the PowerShell completions to not append, but use a dedicated file.
I was planning on adding this to the main documentation. Typically if the completion is loaded at config read time (e.g. ~/.zshrc) no update would be needed. If using a dedicated file, it would be the user's responsibility to re-generate the file after a pip upgrade of the SDK. |
makes sense, my question is more how can we inform the user they need to perform this operation?
but could be done in followup PR |
|
@coderabbitai could you open an issue for the comments in #100 (comment) ? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 51
The issue captures the discussion from
|
What and why
Adds a evalhub completion command group that generates shell completion scripts for bash, zsh, fish, and PowerShell. This improves CLI discoverability and usability by enabling tab-completion for all commands, subcommands, and options.
Type
Testing
Summary by CodeRabbit