ruff/python/ruff-ecosystem
Zanie Blue 9f5102d536
Improve calculation of max display per rule in ecosystem checks (#8291)
Fixes bug where `total_affected_rules` is empty, a division by zero
error can occur if there are only errors and no rule changes. Calculates
the maximum display per rule with the calculated project maximum as the
upper bound instead of 50, this should show more rule variety when
project maximums are lower.

This commit was meant to be in #8223 but I missed it.
2023-10-27 22:04:52 -05:00
..
ruff_ecosystem Improve calculation of max display per rule in ecosystem checks (#8291) 2023-10-27 22:04:52 -05:00
pyproject.toml Rewrite ecosystem checks and add ruff format reports (#8223) 2023-10-27 17:28:01 -05:00
README.md Rewrite ecosystem checks and add ruff format reports (#8223) 2023-10-27 17:28:01 -05:00

ruff-ecosystem

Compare lint and format results for two different ruff versions (e.g. main and a PR) on real world projects.

Installation

From the Ruff project root, install with pip:

pip install -e ./python/ruff-ecosystem

Usage

ruff-ecosystem <check | format> <baseline executable> <comparison executable>

Note executable paths may be absolute, relative to the current working directory, or will be looked up in the current Python environment and PATH.

Run ruff check ecosystem checks comparing your debug build to your system Ruff:

ruff-ecosystem check ruff "./target/debug/ruff"

Run ruff format ecosystem checks comparing your debug build to your system Ruff:

ruff-ecosystem format ruff "./target/debug/ruff"

Development

When developing, it can be useful to set the --pdb flag to drop into a debugger on failure:

ruff-ecosystem check ruff "./target/debug/ruff" --pdb

You can also provide a path to cache checkouts to speed up repeated runs:

ruff-ecosystem check ruff "./target/debug/ruff" --cache ./repos