From 5329c8ca405d3cca7cb7320c8746367158c78b98 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Mon, 20 Oct 2025 13:14:32 -0400 Subject: [PATCH] add preview function --- crates/ruff_python_formatter/src/preview.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ruff_python_formatter/src/preview.rs b/crates/ruff_python_formatter/src/preview.rs index b6479ab1b4..3a3de86ce3 100644 --- a/crates/ruff_python_formatter/src/preview.rs +++ b/crates/ruff_python_formatter/src/preview.rs @@ -36,3 +36,9 @@ pub(crate) const fn is_remove_parens_around_except_types_enabled( ) -> bool { context.is_preview() } + +/// Returns `true` if the [`wrap_comprehension_in`](https://github.com/astral-sh/ruff/pull/TODO) +/// preview style is enabled. +pub(crate) const fn is_wrap_comprehension_in_enabled(context: &PyFormatContext) -> bool { + context.is_preview() +}