rtk-ai / rtk-ai/rtk

`filter_ruff_format` matches pre-0.12 ruff wording, so `rtk ruff format --check` compresses nothing

Open Beginner friendly
#3,930 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli bug good first issue priority:medium
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.