mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
parent
a95deec00f
commit
424b720c19
62 changed files with 1799 additions and 3890 deletions
|
@ -6,9 +6,7 @@ use crate::expression::parentheses::{
|
|||
is_expression_parenthesized, parenthesized, Parentheses, Parenthesize,
|
||||
};
|
||||
use crate::prelude::*;
|
||||
use crate::preview::{
|
||||
is_with_single_item_pre_39_enabled, is_with_single_target_parentheses_enabled,
|
||||
};
|
||||
use crate::preview::is_with_single_target_parentheses_enabled;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum WithItemLayout {
|
||||
|
@ -154,9 +152,7 @@ impl FormatNodeRule<WithItem> for FormatWithItem {
|
|||
}
|
||||
|
||||
WithItemLayout::Python38OrOlder { single } => {
|
||||
let parenthesize = if (single && is_with_single_item_pre_39_enabled(f.context()))
|
||||
|| is_parenthesized
|
||||
{
|
||||
let parenthesize = if single || is_parenthesized {
|
||||
Parenthesize::IfBreaks
|
||||
} else {
|
||||
Parenthesize::IfRequired
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue