mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
Generalize comment-after-bracket handling to lists, sets, etc. (#6320)
## Summary We already support preserving the end-of-line comment in calls and type parameters, as in: ```python foo( # comment bar, ) ``` This PR adds the same behavior for lists, sets, comprehensions, etc., such that we preserve: ```python [ # comment 1, 2, 3, ] ``` And related cases.
This commit is contained in:
parent
d3aa8b4ee0
commit
1d8759d5df
20 changed files with 265 additions and 99 deletions
|
@ -478,7 +478,7 @@ impl<Context> std::fmt::Debug for LineSuffix<'_, Context> {
|
|||
}
|
||||
|
||||
/// Inserts a boundary for line suffixes that forces the printer to print all pending line suffixes.
|
||||
/// Helpful if a line sufix shouldn't pass a certain point.
|
||||
/// Helpful if a line suffix shouldn't pass a certain point.
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue