You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ruff filter: is_format matches a bare format token anywhere in argv, so the passthrough cap is applied inconsistently #3928
let is_format = args.iter().any(|a| a == "format");
is_check is decided from args.first(), is_format from any(). So any invocation carrying a bare format token anywhere selects filter_ruff_format for its output — and filter_ruff_format's fallback branch is a bare result.push_str(output.trim()), which skips the truncate(…, passthrough_max_chars) cap the else branch applies.
Reproduction (ruff 0.16.6, LC_ALL=C)
$ ruff help format | wc -c # 4889
$ rtk ruff help format | wc -c # 4889 <- uncapped
$ ruff help check | wc -c # 6297
$ rtk ruff help check | wc -c # 2001 <- capped at passthrough_max_chars
Two sibling invocations of the same subcommand get different caps, decided by whether the word format appears in argv. Output is correct in both cases — this is over-delivery, not loss — but the routing is accidental.
Suggested direction
Derive it from the same decision is_check_invocation makes:
let is_format = args.first().is_some_and(|a| a == "format");
Predates #3083 (which only changed is_check); it became observable there because non-check subcommands now actually reach the filter.
In ruff_cmd.rs, is_format uses args.iter().any() instead of checking args.first(), causing inconsistent passthrough truncation depending on whether 'format' appears anywhere in argv rather than as the subcommand; fix by matching is_check's pattern.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
ruff_cmd.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
The routing change in #3968 now decides whether a command is a format run from the subcommand rtk routes on, so a bare format token elsewhere in the arguments no longer switches the filter: rtk ruff help format and rtk ruff help check both return ruff's full output on develop. That change is not in a stable release yet (the latest is v1.1.0), so this gets the resolved-pending-close label and will be closed once a release containing it ships. If it still happens on that release, please comment here.
Fixed by #3968, shipped in v1.2.0: the filter is now chosen from the subcommand rtk routes on, so a bare format token elsewhere in the arguments no longer changes the output cap. With ruff 0.17.4, rtk ruff help format and rtk ruff help check both return ruff's full output. If you still see a difference on v1.2.0 or later, please comment here or reopen.
Activity
rtk-wshm-sync-bot commentedon Sep 8, 2026
🔍 Automated Triage
buglowSummary
In ruff_cmd.rs,
is_formatusesargs.iter().any()instead of checkingargs.first(), causing inconsistent passthrough truncation depending on whether 'format' appears anywhere in argv rather than as the subcommand; fix by matchingis_check's pattern.📁 Relevant files
ruff_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
Tiancheng-Xu commentedon Sep 8, 2026
I can take this. I’ll add a focused regression test for argument routing, make the minimal first-argument fix, and open a PR shortly.
KuSh commentedon Oct 31, 2026
The routing change in #3968 now decides whether a command is a format run from the subcommand rtk routes on, so a bare
formattoken elsewhere in the arguments no longer switches the filter:rtk ruff help formatandrtk ruff help checkboth return ruff's full output on develop. That change is not in a stable release yet (the latest is v1.1.0), so this gets the resolved-pending-close label and will be closed once a release containing it ships. If it still happens on that release, please comment here.KuSh commentedon Nov 8, 2026
Fixed by #3968, shipped in v1.2.0: the filter is now chosen from the subcommand rtk routes on, so a bare format token elsewhere in the arguments no longer changes the output cap. With ruff 0.17.4, rtk ruff help format and rtk ruff help check both return ruff's full output. If you still see a difference on v1.2.0 or later, please comment here or reopen.