-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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/black
ifXDG_CONFIG_HOME
is 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 unittest
results 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
.