akkudoktoreos.core.version.collect_files

akkudoktoreos.core.version.collect_files(config: HashConfig) list[Path]

Collect all files that should be included in the hash.

This function only collects files - it doesn’t hash them. Makes it easy to inspect what will be hashed.

Parameters:

config – Hash configuration

Returns:

Sorted list of files to be hashed

Example

>>> config = HashConfig(
...     paths=[Path('src')],
...     allowed_suffixes={'.py'},
...     excluded_dir_patterns={'*__pycache__'},
...     excluded_files=set()
... )
>>> files = collect_files(config)
>>> print(f"Will hash {len(files)} files")
>>> for f in files[:5]:
...     print(f"  {f}")