Skip to content
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

files configuration option missing from config file(s) #2231

Open
harsanyidani opened this issue Feb 9, 2024 · 2 comments
Open

files configuration option missing from config file(s) #2231

harsanyidani opened this issue Feb 9, 2024 · 2 comments

Comments

@harsanyidani
Copy link

harsanyidani commented Feb 9, 2024

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.

@bp72
Copy link
Contributor

bp72 commented Feb 25, 2024

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 :)

@harsanyidani
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants