Skip to content

feat(uv): add uv run filtering to prevent incorrect run injection (fixes #2841)#2869

Open
jlaportebot wants to merge 2 commits into
rtk-ai:developfrom
jlaportebot:fix/uv-run-handler
Open

feat(uv): add uv run filtering to prevent incorrect run injection (fixes #2841)#2869
jlaportebot wants to merge 2 commits into
rtk-ai:developfrom
jlaportebot:fix/uv-run-handler

Conversation

@jlaportebot

Copy link
Copy Markdown

Summary

Adds support for uv run command filtering to prevent incorrect routing through rtk run when users invoke uv run <tool>. This addresses issue #2841 where uv run (high-frequency Python command) was unhandled.

Changes

  • New filter module: src/cmds/python/uv_cmd.rs - Handles uv sync, uv pip list/outdated, and uv run <tool> with routing to appropriate filters
  • Discovery rule: Added pattern for ^uv\s+run\s+ in src/discover/rules.rs with 70% savings estimate
  • CLI integration: Added Uv variant to Commands enum in src/main.rs with proper routing
  • Meta-command registration: Added "uv" to RTK_META_COMMANDS to prevent fallback

Quality Checks

All quality gates pass locally:

  • cargo check
  • cargo test ✓ (2242+ tests pass)
  • cargo clippy --all-targets ✓ (zero warnings)
  • cargo fmt --all --check

Testing

# Test uv sync filtering
rtk uv sync

# Test uv pip list
rtk uv pip list --format=json

# Test uv run routing to pytest
rtk uv run pytest tests/

# Test uv run routing to ruff
rtk uv run ruff check .

# Test uv run routing to mypy
rtk uv run mypy src/

# Test uv run passthrough for unknown tools
rtk uv run some-unknown-tool

Fixes #2841

@jlaportebot jlaportebot force-pushed the fix/uv-run-handler branch from 693f0de to b4b9707 Compare July 7, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add handler for uv run (Python; high-frequency, currently unhandled)

1 participant