black/docs/usage_and_configuration
Shantanu 2623269dab
Ignore pyproject.toml missing tool.black section (#4204)
Fixes #2863

This is pretty desirable in a monorepo situation where you have
configuration in the root since it will mean you don't have to
reconfigure every project.

The good news for backward compatibility is that `find_project_root`
continues to stop at any git or hg root, so in all cases repo root
coincides with a pyproject.toml missing tool.black, we'll continue to
have the project root as before and end up using default config
(i.e. we're unlikely to randomly start using the user config).

The other thing we need to be a little careful about is that changing
find_project_root logic affects what `exclude` is relative to.  Since we
only change in cases where there is no config, this only applies where
users were using `exclude` via command line arg (and had pyproject.toml
missing tool.black in a dir that was not repo root).

Finally, for the few who could be affected, the fix is to put an empty
`[tool.black]` in pyproject.toml
2024-02-01 21:50:45 -08:00
..
black_as_a_server.md Add --unstable flag (#4096) 2024-01-25 17:00:47 -08:00
black_docker_image.md Move Docker image to hatch + compile (#3965) 2023-10-23 08:36:47 -07:00
file_collection_and_discovery.md Fix typo in file_collection_and_discovery.md (GH-2860) 2022-02-10 20:32:55 -05:00
index.md Convert index.rst and license.rst to markdown (#2852) 2022-03-30 13:43:46 -07:00
the_basics.md Ignore pyproject.toml missing tool.black section (#4204) 2024-02-01 21:50:45 -08:00