]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Allow setting custom cache directory on all platforms (#2739)
authorPerry Vargas <perrybvargas@gmail.com>
Sat, 22 Jan 2022 06:00:33 +0000 (22:00 -0800)
committerGitHub <noreply@github.com>
Sat, 22 Jan 2022 06:00:33 +0000 (22:00 -0800)
commit10677baa40f818ca06c6a9d5efa0dca052865bfb
tree0d8d8e05d40de0925b7a7ab627910aa2d5f394d3
parentd24bc4364c6ef2337875be1a5b4e0851adaaf0f6
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.
CHANGES.md
docs/contributing/reference/reference_functions.rst
docs/usage_and_configuration/file_collection_and_discovery.md
src/black/cache.py
tests/test_black.py