Skip to content

Detecting unneeded async keywords on functions #9951

@Greesb

Description

@Greesb

Hello,

I refactored a bunch of code and thought about a rule that could be useful: detecting function defined with the async keywords not using any await inside it, example:

async def unneeded_async() -> None:  # should raise the error
    print("lol")

async def legit_async() -> None:  # should not raise the error
    await some_stuff()

There's probably some use cases where the async is needed, but, imo, most of the time those async can be removed.

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions