microsoft / vscode-isort

Import sorting for python using the isort library.
https://marketplace.visualstudio.com/items?itemName=ms-python.isort
MIT License
87 stars 20 forks source link

Fix for selecting `isort` settings from path #386

Closed archont94 closed 7 months ago

archont94 commented 7 months ago

Replace ${fileDirname} placeholder with proper value, so it can be used with "isort.args": ["--settings-path", "${fileDirname}"].

This should address #53 as isort is able to find first pyproject.toml file in directory above modified file (including multiple nested dirs).

It also allows to modify files outside of current workspace (limitation of "isort.args": ["--settings-path", "${workspaceFolder}/<project>/pyproject.toml"] approach).

archont94 commented 7 months ago

@microsoft-github-policy-service agree

anthonykim1 commented 7 months ago

lint is failing

karthiknadig commented 7 months ago

@archont94 Just run the latest black on this file src/test/python_tests/test_path_specialization.py