#![cfg_attr(coverage_nightly, coverage(off))]
pub mod types;
mod gates;
mod helpers;
mod manager;
use std::path::{Path, PathBuf};
pub use types::{
CacheCheckResult, CacheMissReason, CacheResult, GateCacheEntry, GateCheckResult,
GateDefinition, GateRunResult, HooksCacheMetrics, ParallelGateResults, SmartGateResults,
TreeHashCache,
};
const CACHE_DIR: &str = ".pmat/hooks-cache";
const MAX_CACHE_AGE_HOURS: i64 = 24;
#[derive(Debug)]
pub struct HooksCacheManager {
project_path: PathBuf,
cache_dir: PathBuf,
}
impl HooksCacheManager {
pub fn new(project_path: &Path) -> Self {
let cache_dir = project_path.join(CACHE_DIR);
Self {
project_path: project_path.to_path_buf(),
cache_dir,
}
}
}
#[cfg(test)]
mod tests;