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

--diff option is ignored when input is from stdin. #1469

Closed
falsetru opened this issue Sep 10, 2020 · 5 comments
Closed

--diff option is ignored when input is from stdin. #1469

falsetru opened this issue Sep 10, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@falsetru
Copy link

How to reproduce

echo -e 'import sys\nimport os' | isort - --diff

Actual Behavior

got sorted output (no diff)

import os
import sys

Expected Behavior

Show diff like isort 4.x.x

--- :before	2020-09-10 12:27:51.648963
+++ :after	2020-09-10 12:27:51.648976
@@ -1,2 +1,2 @@
+import os
 import sys
-import os

Version used

5.5.1

@timothycrosley
Copy link
Member

Thanks for reporting this issue!
I've pushed out a hot-fix release that resolves it and adds an additional test case to hopefully keep the regression from coming back. This can be downloaded from PyPI as version 5.5.2

Thanks!

~Timothy

@falsetru
Copy link
Author

5.5.2 solved the issue. Thank you.

@karrtikr
Copy link

@timothycrosley Thanks for the quick fix! Nothing was working for me when upgrading isort to 5.5.1 myself. It seems isort when run from stdin keep regressing. #1447 #1469 I remember atleast one more.

Do we not have the same dedicated test cases when isort is run from stdin as we have when it's run normally?

@timothycrosley
Copy link
Member

@karrtikr I was thinking the same thing! There are tests for stdin, but they are clearly inadequate at the moment. I've added an additional ticket here to track the creation of a more robust test suite for stdin based usage #1472

@timothycrosley timothycrosley added the bug Something isn't working label Sep 10, 2020
@karrtikr
Copy link

Thanks! That'll help

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

3 participants