mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 08:30:30 +00:00
Fix incorrect placement of leading function comment with type params (#12447)
This commit is contained in:
parent
3ace12943e
commit
ed238e0c76
5 changed files with 141 additions and 4 deletions
|
@ -1076,7 +1076,7 @@ fn handle_leading_function_with_decorators_comment(comment: DecoratedComment) ->
|
|||
|
||||
let is_following_parameters = comment
|
||||
.following_node()
|
||||
.is_some_and(|node| node.is_parameters());
|
||||
.is_some_and(|node| node.is_parameters() || node.is_type_params());
|
||||
|
||||
if comment.line_position().is_own_line() && is_preceding_decorator && is_following_parameters {
|
||||
CommentPlacement::dangling(comment.enclosing_node(), comment)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue