mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Format function and class definitions into a single line if its body is an ellipsis (#6592)
This commit is contained in:
parent
bb5fbb1b5c
commit
2a8d24dd4b
15 changed files with 445 additions and 60 deletions
|
@ -11,7 +11,7 @@ use crate::expression::parentheses::{
|
|||
};
|
||||
use crate::other::commas;
|
||||
use crate::prelude::*;
|
||||
use crate::statement::clause::{clause_header, ClauseHeader};
|
||||
use crate::statement::clause::{clause_body, clause_header, ClauseHeader};
|
||||
use crate::{FormatNodeRule, PyFormatOptions};
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -100,7 +100,7 @@ impl FormatNodeRule<StmtWith> for FormatStmtWith {
|
|||
Ok(())
|
||||
})
|
||||
),
|
||||
block_indent(&item.body.format())
|
||||
clause_body(&item.body, colon_comments)
|
||||
]
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue