Skip to content

Support exclusion of specific imports #302

@tjstum

Description

@tjstum

Sometimes we know that a particular import always has side effects and should never be removed. When running autoflake with --remove-all-unused-imports, there's not a way to say "everything except module X, Y and Z."

We can sprinkle # noqa around at each such sight, but I'm wondering if there would be appetite to support a flag like --never-remove or such (that's the inverse of --imports).

If there is some way to do this that I am unaware, please let me know and accept my apologies! If this is intentionally unsupported, that would also be helpful feedback. If this is of interest but just needs a contributor, I could take a look.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions