`rtk ruff` never routes to check when a global flag comes first: `rtk ruff --select F401 src` exits 2 with no output
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in ruff_cmd.rs at is_check_invocation and reproduce the flag-first commands listed in the issue. Trace how implicit-check arguments and genuine top-level flags are distinguished. Done means commands such as rtk ruff --select F401 src and --fix src route through check, while --version and --help remain top-level and the relevant behavior is verified.
Written by the indexing model from the issue text.
Description
ruff_cmd.rs's is_check_invocation treats any leading - as "not a check invocation":
arg == "check" || (!arg.starts_with('-') && !RUFF_SUBCOMMANDS.contains(&arg.as_str()))
So a flag-first implicit check is forwarded verbatim to ruff, which rejects it because the flag belongs to ruff check, not to ruff itself.
Reproduction (ruff 0.16.6, LC_ALL=C)
$ rtk ruff --select F401 src
<empty>
$ echo $?
2
Same for --fix src, --statistics src, -q src. Real ruff --select F401 src also fails (unrecognized subcommand 'src'), so rtk is faithful to ruff here — but the whole point of the implicit-check routing is that rtk ruff src works, and rtk ruff --fix src is the natural next thing a user types. The error text lands on stderr, which the ruff filter drops (see #3772), so the user sees nothing at all.
Verified identical on develop (665b2720) and on #3083's head, so this predates #3083 and is out of that PR's scope.
Suggested direction
Route to check when the first non-flag argument is not a known subcommand, rather than bailing on the first -. Care is needed for genuine top-level flags: --version, -V, --help, -h, --verbose/-v, --quiet/-q, --silent/-s, --config, --isolated are accepted by both ruff and ruff check, so passing them through to check is safe; only --version/-V/--help/-h must stay top-level.
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 42
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rtk-ai/rtk
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug core output-formatting
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
uv_cmd discards print_with_hint's return value, so the tee hint is not counted and savings read 100% Openanalytics bug python
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
area:cli bug good first issue platform:windows priority:medium resolved-pending-close
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
area:cli bug good first issue priority:high
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100