ruff/crates/ruff_dev/src
konstin b8d378b0a3
Add a script that tests formatter stability on repositories (#5055)
## Summary

We want to ensure that once formatted content stays the same when
formatted again, which is known as formatter stability or formatter
idempotency, and that the formatter prints syntactically valid code. As
our test cases cover only a limited amount of code, this allows checking
entire repositories.

This adds a new subcommand to `ruff_dev` which can be invoked as `cargo
run --bin ruff_dev -- check-formatter-stability <repo>`. While initially
only intended to check stability, it has also found cases where the
formatter printed invalid syntax or panicked.

 ## Test Plan

Running this on cpython is already identifying bugs
(https://github.com/astral-sh/ruff/pull/5089)
2023-06-19 14:13:38 +00:00
..
check_formatter_stability.rs Add a script that tests formatter stability on repositories (#5055) 2023-06-19 14:13:38 +00:00
generate_all.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
generate_cli_help.rs Rename ruff_python_semantic's Context struct to SemanticModel (#4565) 2023-05-22 02:35:03 +00:00
generate_docs.rs Update option anchors to include group name (#4711) 2023-05-29 17:26:10 -04:00
generate_json_schema.rs Pre commit without cargo and other pre-PR improvements (#5146) 2023-06-18 11:00:42 +00:00
generate_options.rs Update option anchors to include group name (#4711) 2023-05-29 17:26:10 -04:00
generate_rules_table.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
main.rs Add a script that tests formatter stability on repositories (#5055) 2023-06-19 14:13:38 +00:00
print_ast.rs Upgrade RustPython (#4747) 2023-05-31 08:26:35 +00:00
print_cst.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
print_tokens.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
round_trip.rs Add roundtrip support for Jupyter notebook (#5028) 2023-06-12 23:27:45 +05:30