mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-08 09:30:27 +00:00
Parenthesize multi-context managers (#9222)
This commit is contained in:
parent
fa2c37b411
commit
a06723da2b
13 changed files with 928 additions and 649 deletions
|
@ -39,6 +39,15 @@ pub(crate) const fn is_no_blank_line_before_class_docstring_enabled(
|
|||
context.is_preview()
|
||||
}
|
||||
|
||||
/// Returns `true` if the [`wrap_multiple_context_managers_in_parens`](https://github.com/astral-sh/ruff/issues/8889) preview style is enabled.
|
||||
///
|
||||
/// Unlike Black, we re-use the same preview style feature flag for [`improved_async_statements_handling`](https://github.com/astral-sh/ruff/issues/8890)
|
||||
pub(crate) const fn is_wrap_multiple_context_managers_in_parens_enabled(
|
||||
context: &PyFormatContext,
|
||||
) -> bool {
|
||||
context.is_preview()
|
||||
}
|
||||
|
||||
/// Returns `true` if the [`module_docstring_newlines`](https://github.com/astral-sh/ruff/issues/7995) preview style is enabled.
|
||||
pub(crate) const fn is_module_docstring_newlines_enabled(context: &PyFormatContext) -> bool {
|
||||
context.is_preview()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue