mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
![]() When fixing an invalid escape sequence in an f-string, each f-string element is analyzed for valid escape characters prior to creating the diagnostic and fix. This allows us to safely prefix with `r` to create a raw string if no valid escape characters were found anywhere in the f-string, and otherwise insert backslashes. This fixes a bug in the original implementation: each "f-string part" was treated separately, so it was not possible to tell whether a valid escape character was or would be used elsewhere in the f-string. Progress towards #11491 but format specifiers are not handled in this PR. |
||
---|---|---|
.. | ||
test | ||
__init__.py |