Skip to content

Looking for configuration files like pylintrc or pyproject.toml in parent directories like black or isort #3289

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
rrauenza opened this issue Dec 4, 2019 · 5 comments · Fixed by #7163 or #9093
Labels
Enhancement ✨ Improvement to a component Hacktoberfest
Milestone

Comments

@rrauenza
Copy link

rrauenza commented Dec 4, 2019

Is your feature request related to a problem? Please describe

I use pylint in vi with a pyproject.toml -- pyproject.toml isn't always in my $CWD.

Describe the solution you'd like

What do you think about also looking at ../../.. recursively like you do the .pylintrc?

Additional context

You might want to exclude setup.cfg from this for backwards compatibility.

@PCManticore PCManticore added the Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning label Dec 12, 2019
@PCManticore
Copy link
Contributor

Thanks for the report. I'm not entirely sure what this would entail in terms of UX, we'll need to investigate a little bit what other tools are doing.

@michael-k
Copy link
Contributor

we'll need to investigate a little bit what other tools are doing.

Here's what black is doing: https://github.com/psf/black#where-black-looks-for-the-file
I think it's reasonable to look for a pyproject.toml at least until there's a .git/.hg directory.

And “isort will look up to 25 directories up, from the file it is ran against, to find a project specific configuration.”
https://github.com/timothycrosley/isort#configuring-isort

@AWhetter
Copy link
Contributor

Looking for a .git/.hg directory seems reasonable to me. I did think about looking for other project files that usually live at the root, but most a redundant now because they have been merged into pyproject.toml.

@dclong
Copy link

dclong commented Dec 31, 2020

Any plan to support this feature?

@MrAlexBailey
Copy link

This would be a great feature to have, black's implementation of searching up the tree until it hits a pyproject.toml or .git / .hg directory works really well.

@Pierre-Sassoulas Pierre-Sassoulas added Good first issue Friendly and approachable by new contributors Enhancement ✨ Improvement to a component Help wanted 🙏 Outside help would be appreciated, good for new contributors and removed Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning labels Dec 11, 2021
@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 5, 2022
@Pierre-Sassoulas Pierre-Sassoulas changed the title Looking for pyproject.toml in parent directories. Looking for configuration files like pylintrc or pyproject.toml in parent directories like black or isort Jul 5, 2022
@Pierre-Sassoulas Pierre-Sassoulas removed the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 11, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Sep 13, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.16.0, 3.0 Sep 28, 2022
@Pierre-Sassoulas Pierre-Sassoulas removed Help wanted 🙏 Outside help would be appreciated, good for new contributors Good first issue Friendly and approachable by new contributors labels Sep 28, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0, 3.0.0b1 Apr 30, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0b1, 3.0.0a7 May 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Enhancement ✨ Improvement to a component Hacktoberfest
Projects
None yet
7 participants