use crate::Result;
use std::path::Path;
use super::report::CheckResult;
pub mod audit;
pub mod build;
pub mod clippy;
pub mod doc;
pub mod format;
pub mod license;
pub mod publish;
pub mod semver;
pub mod standards;
pub mod test;
pub mod test_runner;
#[allow(async_fn_in_trait)]
pub trait SafetyCheck {
async fn run(project_path: &Path) -> Result<CheckResult>;
fn name() -> &'static str;
fn description() -> &'static str;
}
pub struct CheckRegistry;
impl CheckRegistry {
pub fn all_checks() -> Vec<super::CheckType> {
vec![
super::CheckType::Format,
super::CheckType::Clippy,
super::CheckType::Build,
super::CheckType::Test,
super::CheckType::Audit,
super::CheckType::Doc,
super::CheckType::PublishDryRun,
super::CheckType::Standards,
super::CheckType::DocCoverage,
super::CheckType::License,
super::CheckType::Semver,
]
}
pub fn get_description(check_type: super::CheckType) -> &'static str {
match check_type {
super::CheckType::Format => "Validates code formatting with rustfmt",
super::CheckType::Clippy => "Runs clippy lints with strict warnings",
super::CheckType::Build => "Ensures project builds successfully",
super::CheckType::Test => "Runs the complete test suite",
super::CheckType::Audit => "Scans for security vulnerabilities",
super::CheckType::Doc => "Builds project documentation",
super::CheckType::PublishDryRun => "Validates crates.io publication",
super::CheckType::Standards => "Validates Ferrous Forge standards",
super::CheckType::DocCoverage => "Checks documentation coverage",
super::CheckType::License => "Validates license compatibility",
super::CheckType::Semver => "Checks semantic versioning compliance",
}
}
}