-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
New line added if import is in function #1277
Comments
The current work around which I am using is to run autopep8 after isort which cleans this up. |
Hi @shardros, Thanks for the positive feedback on the 5.0.0 release, it is really appreciated! I'm sorry you are experiencing this issue, and I hope I can resolve it as quickly as possible. I haven't been able to reproduce it locally or on CI/CD, but I trust with some additional info I will be able to. Could you
Thanks! ~Timothy |
I can't quite reproduce the issue, but I have a similar issue. Isort splits imports in functions in sections, which I don't really like. Running
on a file def main():
import sys
from django import setup produces
In my opinion, splitting the imports into sections inside functions is not that useful. I haven't found a setting which would help with that. |
Hello @timothycrosley, Thank you for your suggestions. Here is a repository with what I believe to be minimal code needed to reproduce the bug. This was tested on windows. I don't have access to a Linux system to test this on right now but will try over the weekend. The output of Sadly Thank you for all of your hard work, Edwin |
I am unable to reproduce @ziima 's issue in the virtual env in this repository which exhibits the original bug. |
You have constrained isort version to 5.0.5. There is already 5.0.7. |
Thanks Timothy for your work on v5, much appreciated! In case it might help locating the issue: we observe the same behaviour when running Windows and Ubuntu through the WSL. Isort works as expected on Github Actions running Ubuntu. |
Thanks everyone for the detailed information on this issue! Based on the details I borrowed a windows machine and was able to reproduce the issue almost right away. This should be fixed in the just release 5.0.8 release, with an additional regression test added to ensure it doesn't reappear. |
Thank you @timothycrosley |
Hello,
Firstly thank you for all your work on
isort
v5 is truely something.I know this is a bit nasty to be doing anyway but if your imports are in a function with one line between them
isort
will always add a new line between them.Before
isort
:After
isort
:After running
isort
a second time:Tested on commit: 686d3c7
The text was updated successfully, but these errors were encountered: