ruff/crates
Dhruv Manilawala f96fa6b0e2
Do not consider f-strings with escaped newlines as multiline (#14624)
## Summary

This PR fixes a bug in the f-string formatting to not consider the
escaped newlines for `is_multiline`. This is done by checking if the
f-string is triple-quoted or not similar to normal string literals.

This is not required to be gated behind preview because the logic change
for `is_multiline` was added in
https://github.com/astral-sh/ruff/pull/14454.

## Test Plan

Add a test case which formats differently on `main`:
https://play.ruff.rs/ea3c55c2-f0fe-474e-b6b8-e3365e0ede5e
2024-11-27 10:25:38 +00:00
..
red_knot Enable logging for directory-renamed test (#14533) 2024-11-22 16:41:46 +00:00
red_knot_python_semantic [red-knot] Fix panic related to f-strings in annotations (#14613) 2024-11-26 16:35:44 +01:00
red_knot_server Workspace discovery (#14308) 2024-11-15 19:20:15 +01:00
red_knot_test [red-knot] Fix unit tests in release mode (#14604) 2024-11-26 15:40:02 +01:00
red_knot_vendored Sync vendored typeshed stubs (#14350) 2024-11-14 22:29:29 -08:00
red_knot_wasm Add tests for python version compatibility (#14430) 2024-11-18 12:26:55 +00:00
red_knot_workspace [red-knot] Fix panic related to f-strings in annotations (#14613) 2024-11-26 16:35:44 +01:00
ruff Ruff 0.8 release (#14486) 2024-11-22 08:45:19 +01:00
ruff_benchmark Fix Red Knot benchmarks on Windows (#14400) 2024-11-17 16:21:09 +00:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_dev Alternate quotes for strings inside f-strings in preview (#13860) 2024-10-23 07:57:53 +02:00
ruff_diagnostics Use a derive macro for Violations (#14557) 2024-11-27 09:41:40 +00:00
ruff_formatter Fix unnecessary space around power op in overlong f-string expressions (#14489) 2024-11-22 13:01:22 +01:00
ruff_graph Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter [ruff] Implement unnecessary-nested-literal (RUF041) (#14323) 2024-11-27 10:01:50 +00:00
ruff_macros Use a derive macro for Violations (#14557) 2024-11-27 09:41:40 +00:00
ruff_notebook Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_python_ast Fix f-string formatting in assignment statement (#14454) 2024-11-26 15:07:18 +05:30
ruff_python_ast_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_codegen Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_formatter Do not consider f-strings with escaped newlines as multiline (#14624) 2024-11-27 10:25:38 +00:00
ruff_python_index Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_literal Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
ruff_python_parser Turn the fuzz-parser script into a properly packaged Python project (#14606) 2024-11-27 08:09:04 +00:00
ruff_python_resolver Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_semantic [flake8-type-checking] Adds implementation for TC007 and TC008 (#12927) 2024-11-27 09:51:20 +01:00
ruff_python_stdlib Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
ruff_python_trivia Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_trivia_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_server Use Result for failed text document retrieval in LSP requests (#14579) 2024-11-25 15:14:30 +05:30
ruff_source_file Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_text_size Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_wasm Ruff 0.8 release (#14486) 2024-11-22 08:45:19 +01:00
ruff_workspace [flake8-import-conventions] Syntax check aliases supplied in configuration for unconventional-import-alias (ICN001) (#14477) 2024-11-21 15:54:49 +00:00