global config not possible if project contains a pyproject.toml
#4411
Labels
T: bug
Something isn't working
pyproject.toml
#4411
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'spyproject.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, thenblack
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.The text was updated successfully, but these errors were encountered: