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

global config not possible if project contains a pyproject.toml #4411

Open
ppena-LiveData opened this issue Jul 24, 2024 · 0 comments
Open
Labels
T: bug Something isn't working

Comments

@ppena-LiveData
Copy link

Describe the bug

We have multiple Python Git projects, which each have their own pyproject.toml, but we don't want to have to copy and paste the same [tool.black] section in each of them and would prefer to be able to have it configured in our user's ~/.black global config file. Unfortunately, black.files.find_pyproject_toml() doesn't check if the project's pyproject.toml file has a [tool.black] section before returning it, so that causes it to never check to see if there's a ~/.black global config file.

To Reproduce

Have a Python Git project with a pyproject.toml file that does not have a [tool.black] section, and have a ~/.black global config file in your user's directory. The file in your user's directory will be ignored.

Expected behavior

If a project's pyproject.toml file does not have a [tool.black] section, then black should look for a user-level ~/.black global config file.

Additional context

NOTE: this is similar to Issue #2863, but this asks for the [tool.black] section-searching to continue and not stop at the project level.

@ppena-LiveData ppena-LiveData added the T: bug Something isn't working label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant