-
-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isort not running outside script path #1718
Comments
Hi @patrickelectric, it looks like (from the outside) you are experiencing the same case as: #1497 - isort uses current working directory as the src directory if you don't explicitly provide one - simply because it has nothing else to go off of! You should be able to fix this by creating a Hope this helps! ~Timothy |
Hi @timothycrosley, thanks! With |
I don't think that's correct, I think it's running it, it's just that the only src path is the run path of isort, so the output would be different. This is common among many CLI tools, as it's unavoidable without more information provided.
Again, if I'm understanding correctly, it works for all files, it's just that in some of the cases you expect different grouping behavior that's based on the src files location being included as a sort path - which only happens if you cd into that directory when no config is setup up.
One option would be to create and then reuse your own custom shared profile - see https://github.com/PyCQA/isort/tree/main However, if the stated case is correct:
Just put your config as a .isort.cfg in the root of your repository and list out any source paths. |
This tools also provide a way to change the running directory, is there such option with isort ? like:
Is there a way to accomplish it via command line ? |
In the end I got |
The only option isort uses the current directory for is to populate the default source paths. So the direct equivalent of
Just list one or more src paths from the command execution (this just allows you to treat multiple sub directories as if they are firstparty imports, if you have the most common case you will only need to specifiy a single src path at the root your repo) |
version: 5.8.0

The text was updated successfully, but these errors were encountered: