use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TemplateGeneratorConfig {
pub rust_version: String,
pub include_cicd: bool,
pub include_docs: bool,
pub include_benchmarks: bool,
pub include_examples: bool,
pub include_gpu: bool,
pub include_distributed: bool,
pub code_style: CodeStyle,
pub license: LicenseType,
pub testing_framework: TestingFramework,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CodeStyle {
pub indentation: IndentationType,
pub import_style: ImportStyle,
pub doc_style: DocStyle,
pub max_line_length: usize,
pub trailing_commas: bool,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum IndentationType {
Spaces(u8),
Tabs,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum ImportStyle {
Grouped,
Alphabetical,
Length,
Mixed,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum DocStyle {
Standard,
Comprehensive,
Minimal,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum LicenseType {
MIT,
Apache2,
GPL3,
BSD3,
Proprietary,
Custom,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum TestingFramework {
Standard,
Proptest,
Criterion,
Custom,
}
impl Default for TemplateGeneratorConfig {
fn default() -> Self {
Self {
rust_version: "1.70.0".to_string(),
include_cicd: true,
include_docs: true,
include_benchmarks: true,
include_examples: true,
include_gpu: false,
include_distributed: false,
code_style: CodeStyle::default(),
license: LicenseType::MIT,
testing_framework: TestingFramework::Standard,
}
}
}
impl Default for CodeStyle {
fn default() -> Self {
Self {
indentation: IndentationType::Spaces(4),
import_style: ImportStyle::Grouped,
doc_style: DocStyle::Standard,
max_line_length: 100,
trailing_commas: true,
}
}
}