Skip to content

Commit

Permalink
Fix preview style name in can_omit_parentheses to is_f_string_forma…
Browse files Browse the repository at this point in the history
…tting_enabled (#13907)
  • Loading branch information
MichaReiser authored Oct 24, 2024
1 parent 3eb4546 commit 7272f83
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/ruff_python_formatter/src/expression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use crate::expression::parentheses::{
use crate::prelude::*;
use crate::preview::{
is_empty_parameters_no_unnecessary_parentheses_around_return_value_enabled,
is_f_string_implicit_concatenated_string_literal_quotes_enabled,
is_hug_parens_with_braces_and_square_brackets_enabled,
is_f_string_formatting_enabled, is_hug_parens_with_braces_and_square_brackets_enabled,
};

mod binary_like;
Expand Down Expand Up @@ -770,7 +769,7 @@ impl<'input> CanOmitOptionalParenthesesVisitor<'input> {
Expr::StringLiteral(ast::ExprStringLiteral { value, .. })
if value.is_implicit_concatenated() =>
{
if !is_f_string_implicit_concatenated_string_literal_quotes_enabled(self.context) {
if !is_f_string_formatting_enabled(self.context) {
self.update_max_precedence(OperatorPrecedence::String);
}

Expand All @@ -779,14 +778,14 @@ impl<'input> CanOmitOptionalParenthesesVisitor<'input> {
Expr::BytesLiteral(ast::ExprBytesLiteral { value, .. })
if value.is_implicit_concatenated() =>
{
if !is_f_string_implicit_concatenated_string_literal_quotes_enabled(self.context) {
if !is_f_string_formatting_enabled(self.context) {
self.update_max_precedence(OperatorPrecedence::String);
}

return;
}
Expr::FString(ast::ExprFString { value, .. }) if value.is_implicit_concatenated() => {
if !is_f_string_implicit_concatenated_string_literal_quotes_enabled(self.context) {
if !is_f_string_formatting_enabled(self.context) {
self.update_max_precedence(OperatorPrecedence::String);
}

Expand Down

0 comments on commit 7272f83

Please sign in to comment.