mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:47 +00:00

## 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.
38 lines
590 B
TOML
38 lines
590 B
TOML
[tool.poetry]
|
|
name = "scripts"
|
|
version = "0.1.0"
|
|
description = ""
|
|
authors = ["Charles Marsh <charlie.r.marsh@gmail.com>"]
|
|
|
|
[tool.poetry.dependencies]
|
|
python = ">=3.10,<3.12"
|
|
autoflake = "*"
|
|
autopep8 = "*"
|
|
black = "*"
|
|
flake8 = "*"
|
|
isort = "*"
|
|
pycodestyle = "*"
|
|
pyflakes = "*"
|
|
pylint = "*"
|
|
yapf = "*"
|
|
|
|
[tool.poetry.dev-dependencies]
|
|
|
|
[tool.poetry.extras]
|
|
formatter = [
|
|
"black",
|
|
"yapf",
|
|
"autopep8",
|
|
]
|
|
linter = [
|
|
"autoflake",
|
|
"flake8",
|
|
"pycodestyle",
|
|
"pyflakes",
|
|
"pylint",
|
|
"isort",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["poetry-core>=1.0.0"]
|
|
build-backend = "poetry.core.masonry.api"
|