Closed RishiMalhotra920 closed 3 days ago
I'm switching over from isort to ruff and one feature I dearly miss is auto-moving imports to the top of the file. I'm using ruff v0.5.0.
Say I have this file a.py
a.py
import numpy import pandas print("hello world") import os print(os, pandas, numpy)
Running the following commands doesn't move the import os to the top.
import os
ruff check --select I --fix a.py ruff format
I know that with isort, running isort . moves the import os to the top.
isort .
Is there a way to enable this for standalone ruff? Also, is there a reason this isn't enabled by default?
To my knowledge, Ruff has no support for the new float-to-top option yet. Did youse the new setting in your project with isort?
float-to-top
I think this can be merged with #1251.
I'm switching over from isort to ruff and one feature I dearly miss is auto-moving imports to the top of the file. I'm using ruff v0.5.0.
Say I have this file
a.py
Running the following commands doesn't move the
import os
to the top.I know that with isort, running
isort .
moves theimport os
to the top.Is there a way to enable this for standalone ruff? Also, is there a reason this isn't enabled by default?