Ruff 2025 style guide (#13906)

Closes #13371
This commit is contained in:
Micha Reiser 2025-01-03 14:16:10 +01:00
parent a95deec00f
commit 424b720c19
62 changed files with 1799 additions and 3890 deletions

View file

@ -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