Black not using global config when running on internal packages #2920
Labels
build & infra
Issues related to build & infrastructure.
meta
Related to repo itself, process, community, ...
style
Running
black
tool locally, on internal packages which include apyproject.toml
file, do not use the global config defined in the mainpyproject.toml
(under root).This issue was introduced since #2884, after adding
pyproject.toml
to all packages, which do not includeblack
config.When
black
is executed over files in the root directory, it does use the global config, since it ever uses only a singlepyproject.toml
each run (see Black lookup-hierarchy). This is still the case when runningtox -e lint
.This issue makes it hard to execute black on changed files during development.
A possible workaround is to add a command arg
black --config pyproject.toml
to makeblack
use the root config file. Though this is a bit cumbersome, and not documented.Steps to reproduce
Run
.tox/lint/bin/black ./opentelemetry-sdk --check
(on a clean repo clone).What is the expected behavior?
No files would be reformatted.
What is the actual behavior?
The text was updated successfully, but these errors were encountered: