black/tests
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
..
data Consistently add trailing comma on typed parameters (#4164) 2024-01-27 13:55:22 -08:00
__init__.py Remove deprecated use of 'setup.py test' (#1275) 2020-05-08 06:23:50 -07:00
conftest.py add support for printing the diff of AST trees when running tests (#3902) 2023-09-28 07:03:24 -07:00
empty.toml Add --target-version option to allow users to choose targeted Python versions (#618) 2019-02-06 18:43:50 -08:00
optional.py Upgrade mypy to 1.6.1 (#4049) 2023-11-18 11:42:36 -08:00
test_black.py Ignore pyproject.toml missing tool.black section (#4204) 2024-02-01 21:50:45 -08:00
test_blackd.py Migrate mypy config to pyproject.toml (#3936) 2023-10-16 05:24:16 -07:00
test_docs.py Test that preview/unstable features are documented (#4187) 2024-01-30 22:22:38 -08:00
test_format.py test preview cases with line-length 1 unless explicitly skipped (#4087) 2023-12-06 07:17:33 -08:00
test_ipynb.py Avoid importing IPython if notebook cells do not contain magics (#3782) 2023-07-16 21:09:26 -04:00
test_no_ipynb.py Enable PYTHONWARNDEFAULTENCODING = 1 in CI (#3763) 2023-07-04 16:38:39 -07:00
test_ranges.py Support formatting specified lines (#4020) 2023-11-06 18:05:25 -08:00
test_schema.py feat: add schema and validate-pyproject support (#4181) 2024-01-29 07:56:48 -08:00
test_trans.py Rewrite mostly useless assert in test_trans.py (#3810) 2023-07-27 12:51:28 -04:00
test.toml Add support for custom python cell magics (#2744) 2022-01-20 16:45:28 -08:00
util.py Add --unstable flag (#4096) 2024-01-25 17:00:47 -08:00