Enable --document-private-items for ruff_python_formatter (#21903)

This commit is contained in:
Brent Westbrook
2025-12-11 08:23:10 -05:00
committed by GitHub
parent 27912d46b1
commit c51727708a
18 changed files with 70 additions and 53 deletions

View File

@@ -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

View File

@@ -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): ...
/// ```