isort icon indicating copy to clipboard operation
isort copied to clipboard

files configuration option missing from config file(s)

Open harsanyidani opened this issue 1 year ago • 2 comments

Is there a reason for not supporting the files option in a config file (for example pyproject.toml)?

For me it would be useful to specify the files/directories in a pyproject.toml file and when I call isort, the files specified in the files option would get sorted without specifying them on the command line.

harsanyidani avatar Feb 09 '24 13:02 harsanyidani

Hi! I hope you're doing well. If you're still looking for a solution to your use case, I wanted to suggest this option: https://pycqa.github.io/isort/docs/configuration/options.html#src-paths. Let me know if it's not what you are looking for :)

bp72 avatar Feb 25 '24 23:02 bp72

Hi! I hope you're doing well. If you're still looking for a solution to your use case, I wanted to suggest this option: https://pycqa.github.io/isort/docs/configuration/options.html#src-paths. Let me know if it's not what you are looking for :)

If I understand the documentation correctly your suggested src-paths option allows to specify a source path (

modules within src paths have their imports automatically categorized as first_party (link)

). So this option modifies how modules within src-paths have their imports sorted. This is not what I am looking for. I want to specify

One or more Python source files that need their imports sorted (link)

in a config file. The documentation says that

Python & Config File Name: Not Supported

for this option.

So my question is still remains: Why is it not supported and will it be upported in the future?

harsanyidani avatar Mar 05 '24 09:03 harsanyidani