Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import after use gets removed #178

Open
Tracked by #272
tolomea opened this issue Mar 10, 2021 · 1 comment
Open
Tracked by #272

Import after use gets removed #178

tolomea opened this issue Mar 10, 2021 · 1 comment
Assignees
Labels
bug Something isn't working changelog Changes should be written to the changelog file. discussion Issue needs to be discussed and concluded.
Milestone

Comments

@tolomea
Copy link

tolomea commented Mar 10, 2021

With 0.7.4 and --remove --include-star-import --ignore-init --gitignore

In code like this

def bob():
    print(sys.path)

import sys

The import gets incorrectly removed.

You might reasonably ask why I even had code like this, in larger files my work flow is to just drop imports in the nearest bit of module level scope and let unimport and isort clean it up.

@hakancelikdev hakancelikdev added bug Something isn't working changelog Changes should be written to the changelog file. feature labels Apr 3, 2021
@hakancelikdev
Copy link
Owner

Unimport is currently using primary analysis methods, this problem will be solved if scope analysis is added.

@hakancelikdev hakancelikdev added discussion Issue needs to be discussed and concluded. and removed feature labels Jul 15, 2022
@hakancelikdev hakancelikdev added this to the 0.1.0 milestone Dec 5, 2022
@hakancelikdev hakancelikdev self-assigned this Dec 5, 2022
@hakancelikdev hakancelikdev mentioned this issue Dec 5, 2022
9 tasks
@hakancelikdev hakancelikdev mentioned this issue Jun 13, 2023
7 tasks
@hakancelikdev hakancelikdev modified the milestones: 1.0.0, 1.1.0 Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog Changes should be written to the changelog file. discussion Issue needs to be discussed and concluded.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants