isort has support for configuring custom sections and ordering.
This support would also need to be tied in with no-lines-before for the custom sections.
I would imagine that the following isort configuration:
known_django=django
known_pandas=pandas,numpy
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,PANDAS,FIRSTPARTY,LOCALFOLDER
no_lines_before=DJANGO,LOCALFOLDER
Would become the following in ruff:
[tool.ruff.isort]
no-lines-before = ["django", "local-folder"]
section-order = ["future", "standard-library", "django", "third-party", "pandas", "first-party", "local-folder"]
[tool.ruff.isort.sections]
django = ["django"]
pandas = ["pandas", "numpy"]
isorthas support for configuring custom sections and ordering.This support would also need to be tied in with
no-lines-beforefor the custom sections.I would imagine that the following
isortconfiguration:Would become the following in
ruff: