From 743c772217507be1d1d64d6f3fdcf4525035d70a Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Thu, 14 Mar 2024 13:27:32 +0530 Subject: [PATCH] Check if string is completely inside f-string --- .../src/rules/flake8_quotes/rules/check_string_quotes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs b/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs index 941818471139d..a3850a854a33f 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs +++ b/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs @@ -437,7 +437,7 @@ pub(crate) fn check_string_quotes(checker: &mut Checker, string_like: StringLike .indexer() .fstring_ranges() .outermost(string_like.start()) - .is_some_and(|outer_range| outer_range != string_like.range()) + .is_some_and(|outer| outer.start() < string_like.start() && string_like.end() < outer.end()) { return; }