Skip to content

Feature request: Make F401 unused-imports configurable for modules with side effects #9962

Closed
@Hnasar

Description

@Hnasar

We have a handful of modules that have import side effects. I know, I know… we should not rely on that (#4056) – but in lieu of fixing everything, would it be possible to configure a list of modules that should never be auto-removed?

I see there's https://docs.astral.sh/ruff/settings/#lint_ignore-init-module-imports but I was hoping there's a chance to avoid this footgun which comes up from time to time by specifying which modules are expected to have import side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configurationhelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions