mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Parenthesize match..case
if
guards (#13513)
This commit is contained in:
parent
8012707348
commit
9442cd8fae
7 changed files with 155 additions and 88 deletions
|
@ -39,6 +39,8 @@ pub(crate) fn is_empty_parameters_no_unnecessary_parentheses_around_return_value
|
|||
|
||||
/// See [#6933](https://github.com/astral-sh/ruff/issues/6933).
|
||||
/// This style also covers the black preview styles `remove_redundant_guard_parens` and `parens_for_long_if_clauses_in_case_block `.
|
||||
/// WARNING: This preview style depends on `is_empty_parameters_no_unnecessary_parentheses_around_return_value_enabled`
|
||||
/// because it relies on the new semantic of `IfBreaksParenthesized`.
|
||||
pub(crate) fn is_match_case_parentheses_enabled(context: &PyFormatContext) -> bool {
|
||||
context.is_preview()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue