Skip to content

Improve relative-imports (TID252) message #9363

Closed
@tjkuson

Description

Running ruff check --select TID252 /tmp/example.py using version 0.1.9 on

from .. import foo

outputs

/tmp/example.py:1:1: TID252 Relative imports from parent modules are banned

I don't think this is a helpful message as it implies such imports don't work and doesn't suggest an improvement. It also doesn't match the style of other Ruff rule messages.

How about Prefer absolute imports to relative imports from parent modules?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions