Issue/1499/float to top single line multiline comment#1501
Conversation
|
How do I preserve the empty line between the module comment and the import lines? |
|
@char101, the simplest answer to this, is that if you don't want imports to float to the very top - don't use that option (the initial intended usage was to use it every once in a while as a one-off after you've added imports in the middle of the file to keep from losing flow). However, I do think the behaviour could be improved in the case that there is an import at the top that already demonstrates a desire to have one extra line after the top comment - I just think that is a separate issue - I filed it here: #1502 Thanks! ~Timothy |
|
I haven't upgraded isort in a few months and with the old isort, float to top is the default behavior, and I have been using it as a convenience to add new imports on top of a function without having to scroll to the top of the file, isort will then move the imports to the top of the file. So to me it feels like an unnecessary regression. Also with the old isort, as far as remember it keeps a single blank line between the module comment and the import lines. |
Fixes #1499: updates isort to correctly detect beginning of single line multi line style comment, and place imports below it.