ruff/crates/ruff_linter
Robsdedude 1d2181623c
[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>
2025-07-24 11:45:45 -04:00
..
resources [ruff] Offer fixes for RUF039 in more cases (#19065) 2025-07-24 11:45:45 -04:00
src [ruff] Offer fixes for RUF039 in more cases (#19065) 2025-07-24 11:45:45 -04:00
Cargo.toml Bump 0.12.5 (#19528) 2025-07-24 09:12:50 -04:00