Support for top-level user configuration#1899
Conversation
|
Currently I've patched Also, what's up with the Fuzz tests? Given that GitHub Actions wouldn't be having a top-level user config for Black, my changes shouldn't affect them. However, it seems that they're failing randomly. |
At the user level, a TOML config can be specified in the following locations: * Windows: ~\.black * Unix-like: $XDG_CONFIG_HOME/black (~/.config/black fallback)
Made those tests use the empty TOML config.
|
I've now cleaned up the git commit history for easy reviewing. |
Instead of changing env vars for the entire black-primer process, they are now changed only for the black subprocess, using a tmpdir.
Solved this by overriding the |
This should resolve #1577. At the user level, a TOML config can now be specified with the following paths (not directories, but paths to the TOML file):
~\.black$XDG_CONFIG_HOME/black(~/.config/blackifXDG_CONFIG_HOMEis not set)These locations are searched only when no configuration in the current project directory is found. I chose these defaults because this is how flake8 and pycodestyle specify their user-level configs.
TODOs:
python -m unittestresults in failed tests if there's a top-level user config, but all of them pass otherwise.black-primer: Same as above, but withblack-primer.