#![cfg_attr(coverage_nightly, coverage(off))]
use super::types::QualityProfile;
use crate::cli::EnforceOutputFormat;
use anyhow::Result;
use std::path::PathBuf;
pub struct EnforcementConfig {
pub max_iterations: u32,
pub target_improvement: Option<f32>,
pub max_time: Option<u64>,
pub apply_suggestions: bool,
pub specific_file: Option<PathBuf>,
pub include_pattern: Option<String>,
pub exclude_pattern: Option<String>,
pub single_file_mode: bool,
pub dry_run: bool,
pub show_progress: bool,
pub format: EnforceOutputFormat,
pub ci_mode: bool,
}
#[provable_contracts_macros::contract("pmat-core.yaml", equation = "path_exists")]
pub fn load_quality_profile(
profile_name: &str,
_config_path: Option<PathBuf>,
) -> Result<QualityProfile> {
match profile_name {
"extreme" => Ok(QualityProfile::default()),
_ => Ok(QualityProfile::default()),
}
}
#[provable_contracts_macros::contract("pmat-core.yaml", equation = "path_exists")]
pub fn initialize_enforcement_environment(
profile_name: &str,
config_path: Option<PathBuf>,
cache_dir: &Option<PathBuf>,
clear_cache: bool,
) -> Result<QualityProfile> {
let profile = load_quality_profile(profile_name, config_path)?;
if clear_cache {
clear_enforcement_cache(cache_dir);
}
Ok(profile)
}
#[provable_contracts_macros::contract("pmat-core.yaml", equation = "path_exists")]
pub fn clear_enforcement_cache(cache_dir: &Option<PathBuf>) {
if let Some(cache_path) = cache_dir {
eprintln!("🧹 Clearing cache at: {}", cache_path.display());
}
}