mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Normalise Hex and unicode escape sequences in string (#9280)
This commit is contained in:
parent
c716acc7a6
commit
5d4825b60f
10 changed files with 263 additions and 113 deletions
|
@ -2,6 +2,7 @@ use ruff_python_ast::StringLiteral;
|
|||
use ruff_text_size::Ranged;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::preview::is_hex_codes_in_unicode_sequences_enabled;
|
||||
use crate::string::{docstring, Quoting, StringPart};
|
||||
use crate::QuoteStyle;
|
||||
|
||||
|
@ -61,6 +62,7 @@ impl Format<PyFormatContext<'_>> for FormatStringLiteral<'_> {
|
|||
&locator,
|
||||
quote_style,
|
||||
f.context().docstring(),
|
||||
is_hex_codes_in_unicode_sequences_enabled(f.context()),
|
||||
);
|
||||
|
||||
if self.layout.is_docstring() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue