`filter_ruff_format` matches pre-0.12 ruff wording, so `rtk ruff format --check` compresses nothing
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 35
Description
filter_ruff_format keys off two strings:
if lower.contains("would reformat:") { … }
if lower.contains("left unchanged") { … }
ruff stopped emitting both in check mode. On ruff 0.16.6 format --check prints unformatted: File would be reformatted per file and N files already formatted as the summary, so neither branch fires and the filter falls through to result.push_str(output.trim()) — an identity function over the full ANSI diagnostic block.
Reproduction (ruff 0.16.6, LC_ALL=C, 2 files, 1 unformatted)
$ ruff format --check . | wc -c # 886
$ rtk ruff format --check . | wc -c # 886 -> 0.0% savings
Against CONTRIBUTING.md's 20% floor, the format path currently delivers nothing. ruff format (write mode) still says 1 file left unchanged and is still summarised correctly, so only the --check path is dead.
Verified identical on develop (665b2720) and on #3083's head — this predates that PR and is out of its scope.
Suggested direction
Match the current wording as well: unformatted: for the per-file lines and already formatted alongside left unchanged for the summary. Keeping both spellings covers old and new ruff. The existing test_filter_ruff_format_needs_formatting / test_filter_ruff_format_all_formatted fixtures use the pre-0.12 strings and pass, which is why the drift went unnoticed — new fixtures should be captured from a current ruff.
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.
Research direction
Locate the filter_ruff_format implementation and read test_filter_ruff_format_needs_formatting and test_filter_ruff_format_all_formatted first. Add coverage for current Ruff 0.16.6 check-mode output while preserving the existing wording fixtures, then run the filter tests and confirm rtk ruff format --check compresses output again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100