Raxol.PreCommit.Cache (Raxol v2.0.1)

View Source

Cache system for pre-commit checks to enable incremental checking.

Caches check results based on file hashes to skip unchanged files, significantly improving performance for large codebases.

Features

  • File hash-based caching
  • Automatic cache invalidation on file changes
  • Per-check result storage
  • Configurable cache directory

Summary

Functions

Clear the entire cache.

Get cached result for a file and check combination.

Get cache statistics.

Clear cache entries older than the specified duration.

Save a check result to the cache.

Functions

clear_cache()

Clear the entire cache.

get_cached_result(file_path, check_name)

Get cached result for a file and check combination.

Returns {:ok, result} if cache hit and file unchanged, :miss otherwise.

get_stats()

Get cache statistics.

prune_cache(max_age_hours \\ 24)

Clear cache entries older than the specified duration.

save_result(file_path, check_name, result)

Save a check result to the cache.