Content-Length: 240929 | pFad | http://github.com/astral-sh/ruff/pull/16756

72 [ruff] Fix `--statistics` reporting for unsafe fixes by ZedThree · Pull Request #16756 · astral-sh/ruff · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ruff] Fix --statistics reporting for unsafe fixes #16756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZedThree
Copy link
Contributor

Fixes #16751

Summary

Previously, unsafe fixes were counted as "fixable" in Printer::write_statistics, in contrast to the behaviour in Printer::write_once. This changes the behaviour to align with write_once, including them only if --unsafe-fixes is set.

We now also reuse Printer::write_summary to avoid duplicating the logic for whether or not to report if there are hidden fixes.

Test Plan

Existing tests modified to use an unsafe-fixable rule, and new ones added to cover the case with --unsafe-fixes

Fixes astral-sh#16751

Previously, unsafe fixes were counted as "fixable" in
`Printer::write_statistics`, in contrast to the behaviour in
`Printer::write_once`. This changes the behaviour to align with
`write_once`, including them only if `--unsafe-fixes` is set.

We now also reuse `Printer::write_summary` to avoid duplicating the
logic for whether or not to report if there are hidden fixes.
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ruff check --statistics shows unsafe fixes as fixable
1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/astral-sh/ruff/pull/16756

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy