Enable --document-private-items for ruff_python_formatter (#21903)
This commit is contained in:
@@ -214,8 +214,9 @@ impl Format<PyFormatContext<'_>> for MaybeParenthesizePattern<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/// This function is very similar to [`can_omit_optional_parentheses`] with the only difference that it is for patterns
|
||||
/// and not expressions.
|
||||
/// This function is very similar to
|
||||
/// [`can_omit_optional_parentheses`](crate::expression::can_omit_optional_parentheses)
|
||||
/// with the only difference that it is for patterns and not expressions.
|
||||
///
|
||||
/// The base idea of the omit optional parentheses layout is to prefer using parentheses of sub-patterns
|
||||
/// when splitting the pattern over introducing new patterns. For example, prefer splitting the sequence pattern in
|
||||
|
||||
@@ -72,8 +72,9 @@ impl FormatNodeRule<PatternArguments> for FormatPatternArguments {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the pattern (which is the only argument to a [`PatternMatchClass`]) is
|
||||
/// parenthesized. Used to avoid falsely assuming that `x` is parenthesized in cases like:
|
||||
/// Returns `true` if the pattern (which is the only argument to a
|
||||
/// [`PatternMatchClass`](ruff_python_ast::PatternMatchClass)) is parenthesized.
|
||||
/// Used to avoid falsely assuming that `x` is parenthesized in cases like:
|
||||
/// ```python
|
||||
/// case Point2D(x): ...
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user