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

Using add_imports makes isort unusable #1297

Closed
ziima opened this issue Jul 7, 2020 · 2 comments
Closed

Using add_imports makes isort unusable #1297

ziima opened this issue Jul 7, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ziima
Copy link

ziima commented Jul 7, 2020

Since the release of isort 5, the add_imports options stopped working.

Let's have a file with only imports:

from __future__ import unicode_literals

from os import path

Running

isort --check-only --diff test.py --add-import 'from __future__ import unicode_literals'

results in

ERROR: /tmp/test/test.py Imports are incorrectly sorted and/or formatted.

with no diff provided.

@timothycrosley timothycrosley added the bug Something isn't working label Jul 8, 2020
@timothycrosley
Copy link
Member

Thanks for reporting this issue! The combination of checking while adding imports wasn't previously tested. I've fixed the issue in 5.0.5 and added an additional regression test to ensure it doesn't resurface.

Thanks!

~Timothy

@ziima
Copy link
Author

ziima commented Jul 8, 2020

I confirm it works with 5.0.5. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants