-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
isortRelated to import sortingRelated to import sorting
Description
Black auto-explodes imports, collections, function calls, etc. when they contain a trailing comma:
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#the-magic-trailing-comma
This means that even though this would fit into one line:
from seven_dwwarfs import (
Grumpy,
Happy,
Sleepy,
Bashful,
Sneezy,
Dopey,
Doc,
)Black will NOT convert it into this:
from seven_dwwarfs import Grumpy, Happy, Sleepy, Bashful, Sneezy, Dopey, DocAs long as the import list contains a trailing comma.
Ruff currently does not have the magic trailing comma handling as far as I can tell and will collapse the import list if it can fit within the line length limit.
See relevant fixed (but not released) issue in isort: PyCQA/isort#1683
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
isortRelated to import sortingRelated to import sorting