black/docs/usage_and_configuration
Perry Vargas 10677baa40
Allow setting custom cache directory on all platforms (#2739)
Fixes #2506

``XDG_CACHE_HOME`` does not work on Windows. To allow for users to set a custom cache directory on all systems I added a new environment variable ``BLACK_CACHE_DIR`` to set the cache directory. The default remains the same so users will only notice a change if that environment variable is set.

The specific use case I have for this is I need to run black on in different processes at the same time. There is a race condition with the cache pickle file that made this rather difficult. A custom cache directory will remove the race condition.

I created ``get_cache_dir`` function in order to test the logic. This is only used to set the ``CACHE_DIR`` constant.
2022-01-21 22:00:33 -08:00
..
black_as_a_server.md Autogenerate black(d|-primer)? help in usage docs (#2212) 2021-05-09 19:35:56 -07:00
black_docker_image.md Docker image usage description (#2412) 2021-11-15 18:47:21 -08:00
file_collection_and_discovery.md Allow setting custom cache directory on all platforms (#2739) 2022-01-21 22:00:33 -08:00
index.rst Docker image usage description (#2412) 2021-11-15 18:47:21 -08:00
the_basics.md Improve CLI reference wording (#2753) 2022-01-07 18:19:03 +02:00