Skip to content

ASYNC115 fix deletes comments #18740

Closed
@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

Applying the ASYNC115 fix can delete comments inside the function args, so should be marked unsafe in that case playground

PS ~\Desktop\New_folder>Set-Content .\issue.py @"
>> import trio
>>
>>
>> async def func():
>>     await ( # 1
>>     trio # 2
>>     # 3
>>     .sleep( # 4
>>     # 5
>>     0 # 6
>>     # 7
>>     ) # 8
>>     ) # 9
>> "@
PS ~\Desktop\New_folder>uvx ruff check --select ASYNC --fix issue.py
Found 1 error (1 fixed, 0 remaining).
PS ~\Desktop\New_folder>Get-Content issue.py
import trio


async def func():
    await ( # 1
    trio.lowlevel.checkpoint() # 8
    ) # 9

Version

ruff 0.12.0 (87f0feb 2025-06-17) + playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violationshelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions