mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 10:01:15 +00:00
Support fmt: skip
for simple-statements and decorators (#6561)
This commit is contained in:
parent
e3ecbe660e
commit
4dc32a00d0
40 changed files with 545 additions and 316 deletions
|
@ -905,7 +905,7 @@ fn handle_leading_class_with_decorators_comment<'a>(
|
|||
comment: DecoratedComment<'a>,
|
||||
class_def: &'a ast::StmtClassDef,
|
||||
) -> CommentPlacement<'a> {
|
||||
if comment.start() < class_def.name.start() {
|
||||
if comment.line_position().is_own_line() && comment.start() < class_def.name.start() {
|
||||
if let Some(decorator) = class_def.decorator_list.last() {
|
||||
if decorator.end() < comment.start() {
|
||||
return CommentPlacement::dangling(class_def, comment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue