ruff
1d218162 - [`ruff`] Offer fixes for `RUF039` in more cases (#19065)

Commit
196 days ago
[`ruff`] Offer fixes for `RUF039` in more cases (#19065) ## Summary Expand cases in which ruff can offer a fix for `RUF039` (some of which are unsafe). While turning `"\n"` (== `\n`) into `r"\n"` (== `\\n`) is not equivalent at run-time, it's still functionally equivalent to do so in the context of [regex patterns](https://docs.python.org/3/library/re.html#regular-expression-syntax) as they themselves interpret the escape sequence. Therefore, an unsafe fix can be offered. Further, this PR also makes ruff offer fixes for byte string literals, not only strings literals as before. ## Test Plan Tests for all escape sequences have been added. ## Related Closes: https://github.com/astral-sh/ruff/issues/16713 --------- Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
Author
Parents
Loading