Skip to content

New rule: useless finally #19158

@harupy

Description

@harupy

Summary

When finally only contains pass, it's useless:

try:
    x = (1 / 0)
finally:
    pass  # <- useless finally

Playground: https://play.ruff.rs/db968565-8152-4cd5-b81b-2005fc0ce58a

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