This config option defines how from imports wrap when they extend past the line_length limit and has 12 possible settings:
from third_party import (lib1, lib2, lib3,
lib4, lib5, ...)
from third_party import (lib1,
lib2,
lib3
lib4,
lib5,
...)
from third_party import \
lib1, lib2, lib3, \
lib4, lib5, lib6
from third_party import (
lib1,
lib2,
lib3,
lib4,
)
from third_party import (
lib1, lib2, lib3, lib4,
lib5, ...)
from third_party import (
lib1, lib2, lib3, lib4,
lib5, ...
)
Same as Mode 5. Deprecated.
from third_party import lib1, lib2, lib3, ... # NOQA
Alternatively, you can set force_single_line
to True
(-sl
on the
command line) and every import will appear on its own line:
from third_party import lib1
from third_party import lib2
from third_party import lib3
...
Same as Mode 3 - Vertical Hanging Indent but the closing parentheses on the last line is indented.
from third_party import (
lib1,
lib2,
lib3,
lib4,
)
Starts a new line with the same from MODULE import
prefix when lines are longer than the line length limit.
from third_party import lib1, lib2, lib3
from third_party import lib4, lib5, lib6
Same as Mode 2 - Hanging Indent but uses parentheses instead of backslash for wrapping long lines.
from third_party import (
lib1, lib2, lib3,
lib4, lib5, lib6)
Same as Mode 0 - Grid but uses backslashes instead of parentheses to group imports.
from third_party import lib1, lib2, lib3, \
lib4, lib5