-
-
Notifications
You must be signed in to change notification settings - Fork 606
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When using add_imports
, isort moves comments following the import section to its beginning.
For example a command
isort --check-only --diff test.py --add-import 'from __future__ import unicode_literals'
applied to a file
from __future__ import unicode_literals
from os import path
# A comment for a constant
ANSWER = 42
results in
ERROR: /tmp/test/test.py Imports are incorrectly sorted and/or formatted.
--- /tmp/test/test.py:before 2020-07-08 13:28:31.901108
+++ /tmp/test/test.py:after 2020-07-08 13:32:21.272221
@@ -1,6 +1,6 @@
+# A comment for a constant
from __future__ import unicode_literals
from os import path
-# A comment for a constant
ANSWER = 42
Affected version: 5.0.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working