Closed dbritto-dev closed 1 year ago
You need to add "I"
to your select
, to enable import sorting -- like:
[tool.ruff]
line-length = 99
target-version = "py310"
select = ["B", "C", "E", "F", "W", "I"]
ignore = ["E501", "B904", "B008"]
exclude = [
"build", "configs", "*.egg-info", ".github", ".githooks", ".vscode", ".nox"
]
I think that should resolve the issue -- but let me know if you see otherwise!
❯ ruff --select I foo.py --diff
--- foo.py
+++ foo.py
@@ -1,5 +1,5 @@
+import datetime as dt
import json
-import datetime as dt
_ = json.dumps({})
__ = dt.datetime.now()
Would fix 1 error(s).
Thanks, I would try it
test_linting.py
pyproject.toml
Result
Info
Note:
Since ruff wasn't able to find any issue with the imports, it wasn't able to fix the sort imports