mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-31 00:43:47 +00:00
Implement basic module formatting (#4784)
* Add Format for Stmt * Implement basic module formatting This implements formatting each statement in a module with a hard line break in between, so that we can start formatting statements. Basic testing is done by the snapshots
This commit is contained in:
parent
28aad95414
commit
63d892f1e4
54 changed files with 2926 additions and 1171 deletions
|
@ -180,11 +180,8 @@ if True:
|
|||
print( "hi" )
|
||||
# trailing
|
||||
"#;
|
||||
let expected = r#"
|
||||
# preceding
|
||||
if True:
|
||||
let expected = r#"if True:
|
||||
print( "hi" )
|
||||
# trailing
|
||||
"#;
|
||||
let actual = format_module(input)?.as_code().to_string();
|
||||
assert_eq!(expected, actual);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue