pub fn cache_path(source: &Path) -> PathBufExpand description
Returns the cache file path for a given source file.
Resolution order:
- If
BEANCOUNT_LOAD_CACHE_FILENAMEis set, substitute{filename}with the source basename and resolve relative paths against the source dir. - Otherwise, default to a hidden dotfile alongside the source via
default_cache_path:path/to/main.beancount→path/to/.main.beancount.cache.
The dotfile prefix matches Python beancount’s .{filename}.picklecache
convention, so the cache stays out of the way of ls and most file
explorers without breaking from the established beancount ecosystem
behavior. See issue #939.
This function reads process env. Tests that need a deterministic path
regardless of the caller’s environment should use default_cache_path
directly.