ruff/scripts
Charlie Marsh 4df9e07a79
Add a benchmarking script for the formatter CLI (#7340)
## Summary

This PR adds a benchmarking script for the formatter, which benchmarks
the Ruff formatter against Black, yapf, and autopep8.

Three benchmarks are included:

1. Format everything.
2. Format everything, but use a single thread.
3. Format everything, but `--check` (don't write to disk).

There's some nuance in figuring out the right combination of arguments
to each command, but the _main_ nuance is to ensure that we always run
the given formatter (and modify the target repo in-place) prior to
benchmarking it, so that the formatters aren't disadvantaged by the
existing formatting of the target repo. (E.g.: prior to benchmarking
Black's preview style, we need to make sure we format the target repo
with Black's preview style; otherwise, preview style appears much
slower.)

Part of https://github.com/astral-sh/ruff/issues/7309.
2023-09-13 13:15:48 -04:00
..
benchmarks Add a benchmarking script for the formatter CLI (#7340) 2023-09-13 13:15:48 -04:00
_utils.py Use __future__ imports in scripts (#5301) 2023-06-22 11:40:16 -04:00
add_plugin.py Port over some fixes from #3747 (#5940) 2023-07-21 03:55:01 +00:00
add_rule.py Create snake_case file if linter is Pylint (#5948) 2023-07-21 22:13:43 -04:00
check_docs_formatted.py Add docs for E275, E231, E251, and E252 (#6700) 2023-08-20 14:51:50 +00:00
check_ecosystem.py Add comment to ecoystem check re. ALL rules (#6943) 2023-08-28 11:28:36 -05:00
Dockerfile.ecosystem Remove outdated feature flag from Dockerfile.ecosystem (#4620) 2023-05-24 08:19:08 +00:00
ecosystem_all_check.py Update scripts/ecosystem_all_check.sh (#5737) 2023-07-13 15:25:22 +02:00
ecosystem_all_check.sh Document ecosystem_all_check.sh input json (#6824) 2023-08-23 20:08:52 +00:00
ecosystem_all_check_entrypoint.sh Make ecosystem all check more generic (#4629) 2023-05-24 16:26:23 +02:00
formatter_ecosystem_checks.sh Update formatter ecosystem checks revisions (#6770) 2023-08-22 14:19:10 -04:00
generate_known_standard_library.py Remove HashMap and HashSet for known-standard-library detection (#5345) 2023-06-23 19:59:03 +00:00
generate_mkdocs.py Add preview documentation section (#7281) 2023-09-12 15:43:31 +00:00
pyproject.toml Check for Any in other types for ANN401 (#5601) 2023-07-13 18:19:27 +05:30
transform_readme.py Use __future__ imports in scripts (#5301) 2023-06-22 11:40:16 -04:00
update_ambiguous_characters.py Use match instead of phf for confusable lookup (#5953) 2023-07-24 02:23:36 +00:00
update_schemastore.py Use SSH clones in update_schemastore.py (#5322) 2023-06-23 09:50:10 -04:00