Skip to content

Rule proposal: Auto-add -> None typehint to functions #8213

@intgr

Description

@intgr

I want to create a new Ruff rule that auto-adds -> None return type hint to functions when no return <value> statements are present.

Clearly there are lots of special cases that need to be handled (yield, raise, @overload, .pyi files, etc).

What do you think?

I pushed a very eary draft #8212, but no point doing thorough review yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions