mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 11:24:35 +00:00
Fix codeblock dynamic line length calculation for indented examples (#13523)
This commit is contained in:
parent
7706f561a9
commit
c046101b79
4 changed files with 1276 additions and 20 deletions
|
@ -44,3 +44,12 @@ pub(crate) fn is_empty_parameters_no_unnecessary_parentheses_around_return_value
|
|||
pub(crate) fn is_match_case_parentheses_enabled(context: &PyFormatContext) -> bool {
|
||||
context.is_preview()
|
||||
}
|
||||
|
||||
/// This preview style fixes a bug with the docstring's `line-length` calculation when using the `dynamic` mode.
|
||||
/// The new style now respects the indent **inside** the docstring and reduces the `line-length` accordingly
|
||||
/// so that the docstring's code block fits into the global line-length setting.
|
||||
pub(crate) fn is_docstring_code_block_in_docstring_indent_enabled(
|
||||
context: &PyFormatContext,
|
||||
) -> bool {
|
||||
context.is_preview()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue