Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve quotes in generated f-strings #15794

Merged
merged 13 commits into from
Jan 29, 2025
Prev Previous commit
Next Next commit
tidy up
  • Loading branch information
ntBre committed Jan 28, 2025
commit 6bfebce9caea3f84e65c69c620898745017ebfc4
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use itertools::Itertools;
use crate::fix::edits::pad;
use ruff_diagnostics::{AlwaysFixableViolation, Diagnostic, Edit, Fix};
use ruff_macros::{derive_message_formats, ViolationMetadata};
use ruff_python_ast::{self as ast, Arguments, Expr, };
use ruff_python_ast::{self as ast, Arguments, Expr};
use ruff_text_size::{Ranged, TextRange};

use crate::checkers::ast::Checker;
Expand Down
3 changes: 1 addition & 2 deletions crates/ruff_python_codegen/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,8 +1312,7 @@ impl<'a> Generator<'a> {
self.unparse_string_literal(string_literal);
}
ast::FStringPart::FString(f_string) => {
let quote = f_string.flags.quote_style();
self.unparse_f_string(&f_string.elements, quote);
self.unparse_f_string(&f_string.elements, f_string.flags.quote_style());
}
}
}
Expand Down
Loading