Ruff reports an error with the following code even though the imports were sorted with isort.
# test.py
from json import decoder
from json import encoder as j_encoder
from json import tool
jdec = decoder.JSONDecoder()
jenv = j_encoder.JSONEncoder()
tool.main()
ruff test.py --select I --isolated
test.py:1:1: I001 Import block is un-sorted or un-formatted
Found 1 error.
1 potentially fixable with the --fix option.
ruff --version
ruff 0.0.239
The order that ruff expects instead is:
# test.py
from json import decoder, tool
from json import encoder as j_encoder
jdec = decoder.JSONDecoder()
jenv = j_encoder.JSONEncoder()
tool.main()
Ruff reports an error with the following code even though the imports were sorted with
isort.The order that ruff expects instead is: