ruff/crates/ruff_python_formatter/src/statement
Charlie Marsh cc278c24e2
Allow up to two empty lines after top-level imports (#6777)
## Summary

For imports, we enforce that there's _at least_ one empty line after an
import (assuming the next statement is _not_ an import), but allow up to
two at the module level.

Closes https://github.com/astral-sh/ruff/issues/6760.

## Test Plan

`cargo test`
2023-08-22 12:27:40 -04:00
..
clause.rs Fix fmt:skip for function with return type (#6733) 2023-08-21 17:45:23 +02:00
mod.rs Support fmt: skip on compound statements (#6593) 2023-08-17 06:05:41 +00:00
stmt_ann_assign.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_assert.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_assign.rs Rename Comments methods (#6649) 2023-08-18 06:37:01 +00:00
stmt_aug_assign.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_break.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_class_def.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
stmt_continue.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_delete.rs Remove some unnecessary ampersands in the formatter (#6667) 2023-08-18 04:18:26 +00:00
stmt_expr.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_for.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
stmt_function_def.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
stmt_global.rs Rename Comments methods (#6649) 2023-08-18 06:37:01 +00:00
stmt_if.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
stmt_import.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_import_from.rs Rename Comments methods (#6649) 2023-08-18 06:37:01 +00:00
stmt_ipy_escape_command.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_match.rs Rename Comments methods (#6649) 2023-08-18 06:37:01 +00:00
stmt_nonlocal.rs Rename Comments methods (#6649) 2023-08-18 06:37:01 +00:00
stmt_pass.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_raise.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_return.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_try.rs Preserve empty lines between try clause headers (#6759) 2023-08-22 11:50:28 +02:00
stmt_type_alias.rs Support fmt: skip for simple-statements and decorators (#6561) 2023-08-17 05:58:19 +00:00
stmt_while.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
stmt_with.rs Format function and class definitions into a single line if its body is an ellipsis (#6592) 2023-08-21 09:02:23 +02:00
suite.rs Allow up to two empty lines after top-level imports (#6777) 2023-08-22 12:27:40 -04:00