spikard_cli/codegen/quality/mod.rs
1//! Quality validation framework for generated code
2//!
3//! This module provides language-specific code quality validation, including syntax checking,
4//! type checking, and linting for all supported target languages (Python, TypeScript, Rust,
5//! Ruby, PHP).
6//!
7//! # Overview
8//!
9//! The [`QualityValidator`] struct orchestrates validation across multiple quality gates:
10//!
11//! - **Syntax validation**: Ensures code parses correctly
12//! - **Type validation**: Verifies type correctness where applicable
13//! - **Lint validation**: Enforces coding standards and best practices
14//!
15//! # Language Support
16//!
17//! Each language uses appropriate native tools:
18//!
19//! - **Python**: `python3 -m py_compile`, `mypy --strict`, `ruff check`
20//! - **TypeScript**: `tsc --noEmit`, `biome check`
21//! - **Ruby**: `ruby -c`, `steep check`
22//! - **PHP**: `php -l`, `phpstan --level=max`
23//! - **Rust**: `cargo check`, `cargo clippy -- -D warnings`
24//!
25//! # Example
26//!
27//! ```ignore
28//! use spikard_cli::codegen::{TargetLanguage, quality::QualityValidator};
29//!
30//! let validator = QualityValidator::new(TargetLanguage::Python);
31//! let report = validator.validate_all("print('hello')")?;
32//!
33//! if !report.is_valid() {
34//! eprintln!("Validation failed: {:?}", report.errors);
35//! }
36//! ```
37
38pub mod validator;
39
40pub use validator::{QualityError, QualityValidator, ValidationReport};