mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 05:25:17 +00:00
Formatter comment handling nits (#6339)
This commit is contained in:
parent
1031bb6550
commit
f4831d5a26
2 changed files with 4 additions and 7 deletions
|
@ -1270,7 +1270,6 @@ impl<'a, 'print> FitsMeasurer<'a, 'print> {
|
||||||
MeasureMode::FirstLine => return Fits::Yes,
|
MeasureMode::FirstLine => return Fits::Yes,
|
||||||
MeasureMode::AllLines => {
|
MeasureMode::AllLines => {
|
||||||
self.state.line_width = 0;
|
self.state.line_width = 0;
|
||||||
self.state.pending_indent = args.indention();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,12 +152,10 @@ impl Format<PyFormatContext<'_>> for FormatTrailingComments<'_> {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
[
|
[
|
||||||
line_suffix(&format_with(|f| {
|
line_suffix(&format_args![
|
||||||
write!(
|
empty_lines(lines_before_comment),
|
||||||
f,
|
format_comment(trailing)
|
||||||
[empty_lines(lines_before_comment), format_comment(trailing)]
|
]),
|
||||||
)
|
|
||||||
})),
|
|
||||||
expand_parent()
|
expand_parent()
|
||||||
]
|
]
|
||||||
)?;
|
)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue