Difference between ruff and isort outputs. #3624
Answered
by
JonathanPlasse
vamshiaruru-virgodesigns
asked this question in
Q&A
-
Hi everyone, checking out the project for the first time. Firstly, great project! The auto fix is great! I am confused about ruff's output for import sorting. For a small testing file like this from api.settings import config
from typing_extensions import ParamSpec
import redis as sync_redis
import redis.asyncio as redis
print(sync_redis, redis, ParamSpec, config) Ruff outputs import redis as sync_redis
import redis.asyncio as redis
from api.settings import config
from typing_extensions import ParamSpec
print(sync_redis, redis, ParamSpec, config) Where as isort outputs import redis as sync_redis
import redis.asyncio as redis
from typing_extensions import ParamSpec
from api.settings import config
print(sync_redis, redis, ParamSpec, config) I find isort's output more appealing, but regardless of what I personally feel, I'd like to understand why ruff sorts the imports this way. What are the rules rust follows? How do they differ from the rules isort follows? Any help is appreciated, thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
JonathanPlasse
Mar 20, 2023
Replies: 1 comment 2 replies
-
Can you try adding src = ["api"]
# or if you use src layout
src = ["src"] |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
vamshiaruru-virgodesigns
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you try adding
src
to your configuration?