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

Add rule for fixing imports which use as with a no-op #171

Open
kkirsche opened this issue Jan 15, 2021 · 2 comments
Open

Add rule for fixing imports which use as with a no-op #171

kkirsche opened this issue Jan 15, 2021 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kkirsche
Copy link

For example:

from example.fixit_ex import ExampleClass as ExampleClass

Should be:

from example.fixit_ex import ExampleClass

Because using as with the same resulting name is a no-operation action.

@Zac-HD
Copy link

Zac-HD commented May 17, 2021

mypy treats it differently though, and other type-checkers might too. I prefer using __all__ but I'd hesitate to autofix this unless the tool has decided to enforce that preference (like shed does).

@amyreese
Copy link
Member

This would be a good fit for the new extra rules package in Fixit 2.0.

@amyreese amyreese added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants