mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:26 +00:00

This PR changes the testing infrastructure to run all black tests and: * Pass if Ruff and Black generate the same formatting * Fail and write a markdown snapshot that shows the input code, the differences between Black and Ruff, Ruffs output, and Blacks output This is achieved by introducing a new `fixture` macro (open to better name suggestions) that "duplicates" the attributed test for every file that matches the specified glob pattern. Creating a new test for each file over having a test that iterates over all files has the advantage that you can run a single test, and that test failures indicate which case is failing. The `fixture` macro also makes it straightforward to e.g. setup our own spec tests that test very specific formatting by creating a new folder and use insta to assert the formatted output.
22 lines
637 B
TOML
22 lines
637 B
TOML
[package]
|
|
name = "ruff_python_formatter"
|
|
version = "0.0.0"
|
|
publish = false
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
clap = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
ruff_formatter = { path = "../ruff_formatter" }
|
|
ruff_text_size = { path = "../ruff_text_size" }
|
|
rustc-hash = { workspace = true }
|
|
rustpython-common = { workspace = true }
|
|
rustpython-parser = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
insta = { version = "1.19.0", features = [] }
|
|
test-case = { version = "2.2.2" }
|
|
ruff_testing_macros = { path = "../ruff_testing_macros" }
|
|
similar = "2.2.1"
|