Open givemepillow opened 1 year ago
Hi! I have the same problem
Before sorting:
from pomcorn.locators.base_locators import (
Locator,
TInitLocator,
TLocator,
XPathLocator,
)
from pomcorn.locators.xpath_locators import (
ButtonWithTextLocator,
ClassLocator,
DataTestIdLocator,
ElementWithTextLocator,
IdLocator,
InputByLabelLocator,
NameLocator,
PropertyLocator,
TagNameLocator,
TextAreaByLabelLocator,
)
__all__ = (
"Locator",
"XPathLocator",
"TInitLocator",
"TLocator",
"ButtonWithTextLocator",
"ClassLocator",
"DataTestIdLocator",
"ElementWithTextLocator",
"IdLocator",
"InputByLabelLocator",
"NameLocator",
"PropertyLocator",
"TagNameLocator",
"TextAreaByLabelLocator",
)
After sorting:
from __all__ = ('ButtonWithTextLocator', 'ClassLocator', 'DataTestIdLocator',
'ElementWithTextLocator', 'IdLocator', 'InputByLabelLocator', 'Locator',
'NameLocator', 'PropertyLocator', 'TInitLocator', 'TLocator',
'TagNameLocator', 'TextAreaByLabelLocator', 'XPathLocator')
ByLabelLocator,
NameLocator,
PropertyLocator,
TagNameLocator,
TextAreaByLabelLocator,
)
__all__ = (
My isort config:
[tool.isort]
profile="black"
line_length=79
multi_line_output=3
skip=[
"_tmp",
"src",
".env",
"env",
".venv",
"venv",
]
known_pytest=[
"pytest",
"_pytest",
"xdist",
]
sections=[
"FUTURE",
"STDLIB",
"THIRDPARTY",
"PYTEST",
"FIRSTPARTY",
"LOCALFOLDER",
]
include_trailing_comma=true
sort_reexports=true
The issue still persists. It did enourmous mess with all __init__
modules in package.
after using
isort file.py --sort-reexports
, becomes:It seems to me that there is a problem with calculating the current index when using reexports in cases where we use multiline exports or add comments to the beginning of the file.