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
rtk ruff check appends . when every path is dash-prefixed or contains =, so rtk ruff check a=b.py lints the whole tree #4752
ruff_cmd::run appends . to an implicit or explicit check when every argument after check passes a.starts_with('-') || a.contains('=') (src/cmds/python/ruff_cmd.rs:95). That test reads paths as flags: a file named a=b.py, any path after -- that starts with -, and a file named -- all count as flags, so . is added and ruff lints the working directory alongside the requested file.
Reproduction (ruff 0.16.6, LC_ALL=C, a clean file next to 61 modules with unused imports; develop 5ab6291, same on v1.0.1):
command
ruff
rtk ruff
check a=b.py
All checks passed!, exit 0
Ruff: 123 issues in 62 files, exit 1
check -- a=b.py
All checks passed!, exit 0
123 issues, exit 1
check -- -dash.py
1 error (the file's own), exit 1
123 issues in 62 files, exit 1
check -- -- (file named --)
All checks passed!, exit 0
123 issues, exit 1
The hook reaches the first row: ruff check a=b.py is rewritten to rtk ruff check a=b.py.
Direction: decide "no path given" from the tokenizer (arg_tokenizer: a free positional, or anything after --, is a path) rather than from the token's spelling. #3968 rewrites this routing and may be the place for it.
Also seen by @Protocol-zero-0 in their review of #4727 (check --isolated -- --statistics, check --isolated -- --).
rtk ruff check misclassifies paths as flags (dash-prefixed, containing '=', or named '--'), causing it to append '.' and lint the whole tree instead of the given file.
📁 Relevant files
src/cmds/python/ruff_cmd.rs
Suggested Actions
Fix ruff_cmd::run's heuristic at src/cmds/python/ruff_cmd.rs:95 to rely on arg_tokenizer classification, not token sp…
Activity
rtk-wshm-sync-bot commentedon Oct 23, 2026
🔍 Automated Triage
bugmediumSummary
rtk ruff check misclassifies paths as flags (dash-prefixed, containing '=', or named '--'), causing it to append '.' and lint the whole tree instead of the given file.
📁 Relevant files
src/cmds/python/ruff_cmd.rsSuggested Actions
ruff_cmd::run's heuristic at src/cmds/python/ruff_cmd.rs:95 to rely on arg_tokenizer classification, not token sp…a=b.py,-- -dash.py, and a file literally named--Triaged automatically by wshm · This is an automated analysis, not a human review.