Parenthesize match..case if guards (#13513)

This commit is contained in:
Micha Reiser 2024-09-26 08:44:33 +02:00 committed by GitHub
parent 8012707348
commit 9442cd8fae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 155 additions and 88 deletions

View file

@ -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()
}