black/docs/contributing
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
..
reference Allow setting custom cache directory on all platforms (#2739) 2022-01-21 22:00:33 -08:00
gauging_changes.md Fix and speedup diff-shades integration (#2773) 2022-01-19 19:05:58 -08:00
index.rst Clarify contributing docs (#2398) 2021-07-24 15:59:53 -07:00
issue_triage.md Include Jelle's review suggestions 2021-05-16 18:24:28 +02:00
release_process.md slightly better example link (#2617) 2021-12-01 13:47:33 -08:00
the_basics.md Create --preview CLI flag (#2752) 2022-01-19 17:34:52 -08:00