mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-07 17:10:31 +00:00
Fix unstable formatting of trailing end-of-line comments of parenthesized attribute values (#16187)
This commit is contained in:
parent
82eae511ca
commit
31180a84e4
4 changed files with 93 additions and 13 deletions
|
@ -1391,10 +1391,8 @@ fn handle_attribute_comment<'a>(
|
|||
.take_while(|token| token.kind == SimpleTokenKind::RParen)
|
||||
.last()
|
||||
{
|
||||
return if comment.start() < right_paren.start() {
|
||||
CommentPlacement::trailing(attribute.value.as_ref(), comment)
|
||||
} else {
|
||||
CommentPlacement::dangling(comment.enclosing_node(), comment)
|
||||
if comment.start() < right_paren.start() {
|
||||
return CommentPlacement::trailing(attribute.value.as_ref(), comment);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue