mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:35 +00:00
Fix preview style name in can_omit_parentheses
to is_f_string_formatting_enabled (#13907)
This commit is contained in:
parent
3eb454699a
commit
7272f83868
1 changed files with 4 additions and 5 deletions
|
@ -21,8 +21,7 @@ use crate::expression::parentheses::{
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::preview::{
|
use crate::preview::{
|
||||||
is_empty_parameters_no_unnecessary_parentheses_around_return_value_enabled,
|
is_empty_parameters_no_unnecessary_parentheses_around_return_value_enabled,
|
||||||
is_f_string_implicit_concatenated_string_literal_quotes_enabled,
|
is_f_string_formatting_enabled, is_hug_parens_with_braces_and_square_brackets_enabled,
|
||||||
is_hug_parens_with_braces_and_square_brackets_enabled,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mod binary_like;
|
mod binary_like;
|
||||||
|
@ -770,7 +769,7 @@ impl<'input> CanOmitOptionalParenthesesVisitor<'input> {
|
||||||
Expr::StringLiteral(ast::ExprStringLiteral { value, .. })
|
Expr::StringLiteral(ast::ExprStringLiteral { value, .. })
|
||||||
if value.is_implicit_concatenated() =>
|
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);
|
self.update_max_precedence(OperatorPrecedence::String);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -779,14 +778,14 @@ impl<'input> CanOmitOptionalParenthesesVisitor<'input> {
|
||||||
Expr::BytesLiteral(ast::ExprBytesLiteral { value, .. })
|
Expr::BytesLiteral(ast::ExprBytesLiteral { value, .. })
|
||||||
if value.is_implicit_concatenated() =>
|
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);
|
self.update_max_precedence(OperatorPrecedence::String);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Expr::FString(ast::ExprFString { value, .. }) if value.is_implicit_concatenated() => {
|
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);
|
self.update_max_precedence(OperatorPrecedence::String);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue