-
Notifications
You must be signed in to change notification settings - Fork 4
Add shell completions #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds Python 3.14 to CI and classifiers, bumps project version and pre-commit hook revisions, updates README with shell-completion and install/order changes, introduces CLI flags and a completion mode in Changes
Sequence Diagram(s)sequenceDiagram
participant User as CLI user
participant Console as console.py
participant Loader as Task loader
participant Executor as Task executor
participant Printer as printer.py
Note over Console: New flags: --complete, --skip-summary, --continue-on-error
User->>Console: invoke CLI with args
alt contains --complete
Console->>Console: parse args (local sys_argv)
Console->>Console: print available flags & task labels
Console-->>User: exit (no tasks run)
else normal run
Console->>Loader: load tasks (suppress completion-only errors)
Loader-->>Console: tasks
Console->>Executor: execute tasks (respect --continue-on-error)
Executor-->>Printer: summary
alt Azure Pipelines
Printer->>Printer: write to fixed TaskSummary.md in temp dir
Printer-->>Console: upload path
else other platforms
Printer-->>Console: standard summary path
end
Console-->>User: exit with status
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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.
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)
vscode_task_runner/console.py (1)
57-69: Consider using iterable unpacking for cleaner code.The completion mode logic is correct, but you can simplify the list concatenation using iterable unpacking as suggested by Ruff.
if _COMPLETE_FLAG in sys_argv: print( "\n".join( - [ - _SKIP_SUMMARY_FLAG, - _CONTINUE_ON_ERROR_FLAG, - ] - + task_choices + [_SKIP_SUMMARY_FLAG, _CONTINUE_ON_ERROR_FLAG, *task_choices] ) ) sys.exit(0)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.github/workflows/test.yml(1 hunks).pre-commit-config.yaml(1 hunks)README.md(4 hunks)pyproject.toml(2 hunks)vscode_task_runner/console.py(4 hunks)vscode_task_runner/printer.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
vscode_task_runner/console.py (4)
vscode_task_runner/parser.py (1)
load_tasks(57-79)vscode_task_runner/exceptions.py (1)
TasksFileNotFound(25-28)vscode_task_runner/printer.py (1)
error(49-58)vscode_task_runner/models/task.py (1)
is_supported(232-246)
🪛 LanguageTool
README.md
[style] ~262-~262: Consider removing “of” to be more concise
Context: ...matting, test, and build tasks, and see all of the results. ```bash vtr --continue-on-err...
(ALL_OF_THE)
🪛 Ruff (0.14.4)
vscode_task_runner/console.py
62-66: Consider iterable unpacking instead of concatenation
Replace with iterable unpacking
(RUF005)
🔇 Additional comments (7)
pyproject.toml (1)
3-3: LGTM! Version bump and Python 3.14 support.The version bump to 3.0.1 is appropriate for the new shell completion feature, and adding Python 3.14 to the classifiers aligns with the updated test matrix.
Also applies to: 17-17
vscode_task_runner/console.py (3)
15-17: LGTM! Good use of constants for flags.Defining flag constants makes the code more maintainable and reduces the risk of typos.
38-48: LGTM! Consistent use of flag constants.Using the flag constants in the argument parser setup improves maintainability.
109-121: LGTM! Proper error suppression during completion.Extracting
sys_argvonce and suppressing error output during completion mode is the correct approach, as users don't need error messages when tab-completing..pre-commit-config.yaml (1)
19-19: Verification complete: all hook versions are confirmed stable.All three versions are legitimate stable releases published recently:
- uv-pre-commit 0.9.5 — stable, published 2025-10-21
- ruff-pre-commit v0.14.2 — stable, published 2025-10-23
- pyright-python v1.1.406 — stable, published 2025-10-02
No issues with the version bumps.
vscode_task_runner/printer.py (1)
135-140: I need to gather more specific information about Azure Pipelines' task execution model and temp directory handling to assess whether the fixed filename race condition is a genuine concern.Based on my investigation, I've found clear evidence that the review comment misunderstands Azure Pipelines' execution model.
A job is a series of steps that run sequentially as a unit—the smallest unit of work that can be scheduled to run. The agent runs steps sequentially. Before a step starts, all previous steps must finish or be skipped. Additionally, each agent can only run one job at a time.
Agent.TempDirectory is a temporary folder that is cleaned after each pipeline job. This means each job receives an isolated temp directory.
The concern about concurrent runs overwriting each other's file is not applicable in Azure Pipelines. Different pipeline runs/jobs (which is what "concurrent runs" most likely refers to) each have their own isolated temp directory. Within a single job, tasks cannot execute concurrently—they run sequentially. Therefore, using a fixed filename like
TaskSummary.mdposes no race condition risk in this context.Likely an incorrect or invalid review comment.
.github/workflows/test.yml (1)
21-21: No action required—Python 3.14 is available in GitHub Actions.As of November 13, 2025, GitHub's setup-python action supports Python 3.14, so this configuration is valid.
README.md
Outdated
| _vscode_task_runnner_completion() { | ||
| local IFS=$'\n' | ||
| COMPREPLY=($(compgen -W "$(vtr --complete)" -- "${COMP_WORDS[COMP_CWORD]}")) | ||
| } | ||
| complete -F _vscode_task_runnner_completion vtr | ||
| complete -F _vscode_task_runnner_completion vscode-task-runner | ||
| # ========================= | ||
| # Zsh, typically ~/.zshrc | ||
| _vscode_task_runnner_completion() { | ||
| local -a completions=("${(f)$(vtr --complete)}") | ||
| compadd -a -- completions | ||
| } | ||
| compdef _vscode_task_runnner_completion vtr | ||
| compdef _vscode_task_runnner_completion vscode-task-runner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in shell completion function names.
The function names have an extra 'n': _vscode_task_runnner_completion should be _vscode_task_runner_completion (matching the package name with two n's, not three).
Apply this correction to the Bash example:
-_vscode_task_runnner_completion() {
+_vscode_task_runner_completion() {
local IFS=$'\n'
COMPREPLY=($(compgen -W "$(vtr --complete)" -- "${COMP_WORDS[COMP_CWORD]}"))
}
-complete -F _vscode_task_runnner_completion vtr
-complete -F _vscode_task_runnner_completion vscode-task-runner
+complete -F _vscode_task_runner_completion vtr
+complete -F _vscode_task_runner_completion vscode-task-runnerAnd to the Zsh example:
-_vscode_task_runnner_completion() {
+_vscode_task_runner_completion() {
local -a completions=("${(f)$(vtr --complete)}")
compadd -a -- completions
}
-compdef _vscode_task_runnner_completion vtr
-compdef _vscode_task_runnner_completion vscode-task-runner
+compdef _vscode_task_runner_completion vtr
+compdef _vscode_task_runner_completion vscode-task-runner🤖 Prompt for AI Agents
In README.md around lines 206 to 220 the shell completion function and its
registrations are misspelled as _vscode_task_runnner_completion (three n's);
rename the function to _vscode_task_runner_completion (two n's) in both the Bash
section (function definition and both complete -F lines) and the Zsh section
(function definition and both compdef lines) so the function name matches the
package name and is consistent across examples.
* Update pre-commit hooks (#97) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update parser.py (#98) * Add unicode tests * Support .code-workspace files (#101) * Add docs for code workspace * Reorganize lines slightly * Improve error * Typo * Simplify lookup * Add tests * Use uv build backend * Update pre-commit hooks * Update pre-commit hooks (#103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Version 2.2.0 (#106) * Add build summary feature * Add tests and branch coverage * Remove group if there is only one task * Improve coverage * Add uv version * Update README * Support parallel task execution (#108) * Support parallel task execution * Fix tests * Fix subprocess output * Test bandaid * Add parallel check * Fix task execution levels * Formatting [ci skip] * Replace platform constants with Enum * Add rainbow colors to parallel task output * Bump version * Update CI steps (#111) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#110) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#113) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update CI steps (#114) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add shell completions (#115) * Update deps * Add shell completions #112 * Remove extra space * README updates and predicatble name for ADO summary * Formatting * Use newline for splitting options * Add scripts for zsh and fish * Condense * Better handle errors * Update pre-commit config * Update docs * Simplify --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: VisualPlugin <[email protected]>
* Update pre-commit hooks (#97) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update parser.py (#98) * Add unicode tests * Support .code-workspace files (#101) * Add docs for code workspace * Reorganize lines slightly * Improve error * Typo * Simplify lookup * Add tests * Use uv build backend * Update pre-commit hooks * Update pre-commit hooks (#103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Version 2.2.0 (#106) * Add build summary feature * Add tests and branch coverage * Remove group if there is only one task * Improve coverage * Add uv version * Update README * Support parallel task execution (#108) * Support parallel task execution * Fix tests * Fix subprocess output * Test bandaid * Add parallel check * Fix task execution levels * Formatting [ci skip] * Replace platform constants with Enum * Add rainbow colors to parallel task output * Bump version * Update CI steps (#111) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#110) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update pre-commit hooks (#113) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update CI steps (#114) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add shell completions (#115) * Update deps * Add shell completions #112 * Remove extra space * README updates and predicatble name for ADO summary * Formatting * Use newline for splitting options * Add scripts for zsh and fish * Condense * Better handle errors * Update pre-commit config * Update docs * Simplify --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: VisualPlugin <[email protected]>
Summary by CodeRabbit
New Features
Documentation
Chores
Bug Fix / Behavior