mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-14 22:35:11 +00:00
Improve FormatExprCall dummy (#5290)
This solves an instability when formatting cpython. It also introduces another one, but i think it's still a worthwhile change for now. There's no proper testing since this is just a dummy.
This commit is contained in:
parent
2c63f8cdea
commit
7d4f8e59da
37 changed files with 403 additions and 374 deletions
|
@ -10,11 +10,20 @@ use rustpython_parser::ast::ExprCall;
|
|||
pub struct FormatExprCall;
|
||||
|
||||
impl FormatNodeRule<ExprCall> for FormatExprCall {
|
||||
fn fmt_fields(&self, _item: &ExprCall, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
write!(
|
||||
f,
|
||||
[not_yet_implemented_custom_text("NOT_IMPLEMENTED_call()")]
|
||||
)
|
||||
fn fmt_fields(&self, item: &ExprCall, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
if item.args.is_empty() && item.keywords.is_empty() {
|
||||
write!(
|
||||
f,
|
||||
[not_yet_implemented_custom_text("NOT_IMPLEMENTED_call()")]
|
||||
)
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
[not_yet_implemented_custom_text(
|
||||
"NOT_IMPLEMENTED_call(NOT_IMPLEMENTED_arg)"
|
||||
)]
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue