Closed GarrisonD closed 1 year ago
@GarrisonD The bundled isort
is not in your environment, so you cannot run the command line as is, if you want this to work from command line then do this:
isort
in your environmentisort.importStrategy
to fromEnvironment
The way we use the bundled isort
is by adding it to path when running the server. This is done avoid isort or its dependencies interfering with your environment. In the logs we print out the equivalent command for everything the server runs.
Makes sense. But why doesn't --profile black
work with bundled isort
? Isn't it just a set of configurations being applied?
Share your full settings and logs, it should work:
This is how I have it in my settings:
"isort.args": ["--profile", "black"],
if you set "isort.logLevel": "debug",
it should give you detailed info on where it is picking up each setting.
In Output
I see that this option is passed but the result is different to isort that I run in a Docker container. The only difference I can think about is that on the host I don't have any libs and in the Docker container I have:
Set "isort.logLevel": "debug"
and see the logs, isort
looks for settings from several locations including your home directory. I recommend comparing the settings it finds between the two environments.
When I say settings i don't mean isort extension setting. with debug mode set the extension will run isort --show-config
, I recommend getting log and check between the two environments and seeing why it differs.
@karthiknadig With your advice, I could investigate and solve all the issues. Thanks a lot!
In
Output
I can see:If I copy this line and just paste in the terminal I get:
But somehow imports get reformatted (just alphabetically but anyway) in VS Code... That's 🪄