ruff
d55ed14f - Handle renamed rules in ecosystem reports (#30468)

Commit
13 hours ago
Handle renamed rules in ecosystem reports (#30468) Summary -- This PR updates our ecosystem report to run unknown rule names through [renamed-rule (RUF202)](https://docs.astral.sh/ruff/rules/renamed-rule/) before normalizing them back to codes. In my first rule rename PR, the stable ecosystem report failed on typeshed because its configuration uses the human-readable name of one of the renamed rules. Our current normalization process relies on `ruff rule --all --output-format=json`, which no longer contains the old rule name, causing the human-readable name not to be mapped back to a code, which fails on stable: ``` ruff failed Cause: Invalid selector `blank-line-after-function` in `ignore` from `/home/runner/work/_temp/ruff-ecosystem-checkouts/python:typeshed/pyproject.toml`. Selecting rules by name requires preview mode ``` https://github.com/astral-sh/ruff/actions/runs/43917728573/job/133476621427 Instead of running `RUF202` on every config file as I initially pictured, we synthesize a config file containing only any unknown rule names and send that to Ruff via stdin. This both avoids the performance cost of creating a subprocess for every project/config and retains some ecosystem coverage for redirected prefixes and codes. Test Plan -- CI on #30465, which I'll stack on this PR
Author
Parents
Loading