mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Format if
statements (#4961)
This commit is contained in:
parent
548a3cbb3f
commit
1accbeffd6
26 changed files with 882 additions and 357 deletions
|
@ -248,7 +248,8 @@ if True:
|
|||
# trailing
|
||||
"#;
|
||||
let expected = r#"# preceding
|
||||
NOT_YET_IMPLEMENTED_StmtIf
|
||||
if True:
|
||||
NOT_IMPLEMENTED_call()
|
||||
# trailing
|
||||
"#;
|
||||
let actual = format_module(input)?.as_code().to_string();
|
||||
|
@ -436,6 +437,11 @@ def with_leading_comment(): ...
|
|||
// .document()
|
||||
// .display(formatted.context().source_code()));
|
||||
|
||||
// dbg!(formatted
|
||||
// .context()
|
||||
// .comments()
|
||||
// .debug(formatted.context().source_code()));
|
||||
|
||||
let printed = formatted.print().unwrap();
|
||||
|
||||
assert_eq!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue