ruff/crates/ruff_python_formatter/src/statement
Dylan 62343a101a
Respect `fmt: skip` for compound statements on single line (#20633)
Closes #11216

Essentially the approach is to implement `Format` for a new struct
`FormatClause` which is just a clause header _and_ its body. We then
have the information we need to see whether there is a skip suppression
comment on the last child in the body and it all fits on one line.
2025-11-18 12:02:09 -06:00
..
clause.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
mod.rs Preserve trailing statement semicolons when using `fmt: skip` (#8273) 2023-10-30 00:07:14 +00:00
stmt_ann_assign.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_assert.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_assign.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_aug_assign.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_break.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
stmt_class_def.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_continue.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
stmt_delete.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_expr.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
stmt_for.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_function_def.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_global.rs Remove `AstNode` and `AnyNode` (#15479) 2025-01-17 17:11:00 -05:00
stmt_if.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_import.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_import_from.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_ipy_escape_command.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
stmt_match.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_nonlocal.rs Remove `AstNode` and `AnyNode` (#15479) 2025-01-17 17:11:00 -05:00
stmt_pass.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
stmt_raise.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_return.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_try.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_type_alias.rs [ty] AST garbage collection (#18482) 2025-06-13 08:40:11 -04:00
stmt_while.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
stmt_with.rs Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
suite.rs Allow newlines after function headers without docstrings (#21110) 2025-10-31 14:53:40 -04:00