ruff/crates/ruff_python_formatter/src/statement
konsti 317d3dd612
Add test and basic implementation for formatter preview mode (#8044)
**Summary** Prepare for the black preview style becoming the black
stable style at the end of the year.

This adds a new test file to compare stable and preview on some relevant
preview options in black, and makes `format_dev` understand the black
preview flag. I've added poetry as a project that uses preview.

I've implemented one specific deviation (collapsing of stub
implementation in non-stub files) which showed up in poetry for testing.
This also improves poetry compatibility from 0.99891 to 0.99919.

Fixes #7440

New compatibility stats:
| project | similarity index | total files | changed files |

|----------------|------------------:|------------------:|------------------:|
| cpython | 0.75803 | 1799 | 1647 |
| django | 0.99983 | 2772 | 35 |
| home-assistant | 0.99953 | 10596 | 189 |
| poetry | 0.99919 | 317 | 12 |
| transformers | 0.99963 | 2657 | 332 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99978 | 3669 | 20 |
| warehouse | 0.99969 | 654 | 15 |
| zulip | 0.99970 | 1459 | 22 |
2023-10-26 15:33:26 +00:00
..
clause.rs Add test and basic implementation for formatter preview mode (#8044) 2023-10-26 15:33:26 +00:00
mod.rs Support fmt: skip on compound statements (#6593) 2023-08-17 06:05:41 +00:00
stmt_ann_assign.rs Avoid introducing new parentheses in annotated assignments (#8233) 2023-10-25 22:51:50 -04:00
stmt_assert.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_assign.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_aug_assign.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_break.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_class_def.rs Insert necessary blank line between class and leading comments (#8224) 2023-10-25 20:31:59 -04:00
stmt_continue.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_delete.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_expr.rs Use the formatter prelude in more files (#6882) 2023-08-25 16:51:07 -04:00
stmt_for.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_function_def.rs Insert necessary blank line between class and leading comments (#8224) 2023-10-25 20:31:59 -04:00
stmt_global.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
stmt_if.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
stmt_import.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_import_from.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
stmt_ipy_escape_command.rs Memoize text width (#6552) 2023-09-06 07:10:13 +00:00
stmt_match.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_nonlocal.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
stmt_pass.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_raise.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_return.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_try.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_type_alias.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
stmt_while.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
stmt_with.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
suite.rs Fix fmt:off with trailing child comment (#8234) 2023-10-26 01:03:34 +00:00