Skip to content

fix(ruff): preserve non-check subcommands#2670

Open
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:fix/ruff-subcommand-routing
Open

fix(ruff): preserve non-check subcommands#2670
fengjikui wants to merge 1 commit into
rtk-ai:developfrom
fengjikui:fix/ruff-subcommand-routing

Conversation

@fengjikui

Copy link
Copy Markdown

Summary

Fixes #2669.

rtk ruff previously treated every first positional argument except format and version as a check target. That meant real Ruff subcommands such as rule, config, and linter were rewritten as ruff check --output-format=json ..., which makes those subcommands fail.

This changes the routing logic to use a known Ruff subcommand allowlist. Paths such as src and explicit check still route through the JSON check path, while non-check subcommands pass through unchanged.

Validation

  • cargo test test_ruff_ -- --nocapture
  • cargo fmt --check && cargo test ruff_cmd -- --nocapture

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.

ruff subcommand misrouting: rule, config, linter, etc. get check --output-format=json injected

1 participant