MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _get_default_directory

Function _get_default_directory

pre_commit/store.py:25–36  ·  view source on GitHub ↗

Returns the default directory for the Store. This is intentionally underscored to indicate that `Store.get_default_directory` is the intended way to get this information. This is also done so `Store.get_default_directory` can be mocked in tests and `_get_default_directory` can be t

()

Source from the content-addressed store, hash-verified

23
24
25def _get_default_directory() -> str:
26 """Returns the default directory for the Store. This is intentionally
27 underscored to indicate that `Store.get_default_directory` is the intended
28 way to get this information. This is also done so
29 `Store.get_default_directory` can be mocked in tests and
30 `_get_default_directory` can be tested.
31 """
32 ret = os.environ.get('PRE_COMMIT_HOME') or os.path.join(
33 os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),
34 'pre-commit',
35 )
36 return os.path.realpath(ret)
37
38
39_LOCAL_RESOURCES = (

Calls 1

getMethod · 0.45