Repository navigation
Conversation
📊 Automated PR Analysis
SummaryFixes Review Checklist
Linked issues: #4701 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Protocol-zero-0
left a comment
There was a problem hiding this comment.
Independently checked 0f786e17 against develop 5ab62913 with real Ruff 0.17.0 on Linux. The default check --statistics table now matches native stdout byte for byte; the base injects JSON instead. Explicit JSON (both spellings), full/concise, empty results, --exit-zero, rule selection, quiet mode, a path-first implicit check, a file named format, and help also preserve native statistics output in the tested cases. The path-first shorthand was compared with native ruff check plus the same arguments.
23 scenarios / 69 native-base-head processes: exit codes match throughout. Ordinary diagnostics, clean runs, explicit diagnostic JSON, an attached --cache-dir=--statistics value and flag-first routing retain base behavior. Missing values, invalid statistics values and duplicate formats still reject with exit 2; the invalid-statistics usage text now also matches native Ruff. The 22 Ruff unit tests, fmt and warnings-denied all-target clippy pass.
One inherited boundary remains separate: check -- --statistics (a filename) adds . and scans extra files on both base and head. This change correctly avoids treating that filename as the statistics flag; it does not repair the added-dot behavior. No full-suite, other-platform or pending-PR integration claim. No blocker found for this scoped statistics fix.
0f786e1 to
af052f7
Compare
rtk injected --output-format=json into every `ruff check` where the user chose no format. With --statistics ruff then prints a statistics array instead of diagnostics, which filter_ruff_check_json cannot read, so the JSON came back as-is: larger than ruff's own table and in a different shape. Detect --statistics through the argument tokenizer, so a path after `--` or an attached value is not mistaken for the flag. When present, leave the format to ruff and pass the output through, also when the user asked for JSON themselves. Closes rtk-ai#4701
af052f7 to
e44d906
Compare
|
Rebased onto current |
Summary
rtk ruff check --statisticsno longer injects--output-format=json. The statistics output goes to passthrough, so it matches ruff's own table byte for byte (80 B in my repro, same exit code). It used to be pretty-printed JSON that the diagnostics filter could not parse.--output-format=jsontogether with--statistics. That output is a statistics array, not diagnostics, so it passes through instead of reachingfilter_ruff_check_json.--statisticsis detected witharg_tokenizer::tokenize, so a path after--or a flag's value spelled--statisticsdoesn't trigger it.rtk ruff checkis unchanged: JSON is injected and the output is filtered.Closes #4701
Test plan
check_formatdecision.statistics_keeps_ruffs_own_formatfailed before the fix, and the others pin the existing behaviour.rtk ruff check --statisticsagainst ruff 0.15.12 gives the same table as native.cargo fmt --all && cargo clippy --all-targets && cargo test --all: fmt is clean, clippy gives 0 warnings, all 22 ruff tests pass, and the other failures are listed below.All checks ran on Windows 11 with
cargo +1.99.0. The remaining test failures also fail on unmodifieddevelop(5ab6291) on that machine:find_cmd::run_from_args_propagates_find_exit_statusandcore::stream::test_read_lines_lossy_preserves_lines_after_invalid_utf8fail on every run.rewrite_shell_wrapper_testfails intermittently, on a different test each run.a_clustered_h_is_answered_by_git_oncefails ondeveloptoo.a_wrapped_tools_own_help_survives_rtkwas skipped because it opens browser tabs on Windows (#4728).