mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-14 22:35:11 +00:00
Fix unstable set comprehension formatting (#5327)
This commit is contained in:
parent
930f03de98
commit
2dfa6ff58d
4 changed files with 35 additions and 13 deletions
|
@ -2,7 +2,7 @@ use crate::comments::Comments;
|
|||
use crate::expression::parentheses::{
|
||||
default_expression_needs_parentheses, NeedsParentheses, Parentheses, Parenthesize,
|
||||
};
|
||||
use crate::{not_yet_implemented, FormatNodeRule, PyFormatter};
|
||||
use crate::{not_yet_implemented_custom_text, FormatNodeRule, PyFormatter};
|
||||
use ruff_formatter::{write, Buffer, FormatResult};
|
||||
use rustpython_parser::ast::ExprSetComp;
|
||||
|
||||
|
@ -10,8 +10,13 @@ use rustpython_parser::ast::ExprSetComp;
|
|||
pub struct FormatExprSetComp;
|
||||
|
||||
impl FormatNodeRule<ExprSetComp> for FormatExprSetComp {
|
||||
fn fmt_fields(&self, item: &ExprSetComp, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
write!(f, [not_yet_implemented(item)])
|
||||
fn fmt_fields(&self, _item: &ExprSetComp, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
write!(
|
||||
f,
|
||||
[not_yet_implemented_custom_text(
|
||||
"{NOT_IMPLEMENTED_set_value for value in NOT_IMPLEMENTED_set}"
|
||||
)]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue