ralph/commands/context/
types.rs1use crate::cli::context::ProjectTypeHint;
12
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
15pub enum DetectedProjectType {
16 Rust,
17 Python,
18 TypeScript,
19 Go,
20 Generic,
21}
22
23impl std::fmt::Display for DetectedProjectType {
24 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25 match self {
26 DetectedProjectType::Rust => write!(f, "rust"),
27 DetectedProjectType::Python => write!(f, "python"),
28 DetectedProjectType::TypeScript => write!(f, "typescript"),
29 DetectedProjectType::Go => write!(f, "go"),
30 DetectedProjectType::Generic => write!(f, "generic"),
31 }
32 }
33}
34
35#[derive(Debug, Clone, Copy, PartialEq, Eq)]
37pub enum FileInitStatus {
38 Created,
39 Valid,
40}
41
42pub struct ContextInitOptions {
44 pub force: bool,
45 pub project_type_hint: Option<ProjectTypeHint>,
46 pub output_path: std::path::PathBuf,
47 pub interactive: bool,
48}
49
50pub struct ContextUpdateOptions {
52 pub sections: Vec<String>,
53 pub file: Option<std::path::PathBuf>,
54 pub interactive: bool,
55 pub dry_run: bool,
56 pub output_path: std::path::PathBuf,
57}
58
59pub struct ContextValidateOptions {
61 pub strict: bool,
62 pub path: std::path::PathBuf,
63}
64
65pub struct InitReport {
67 pub status: FileInitStatus,
68 pub detected_project_type: DetectedProjectType,
69 pub output_path: std::path::PathBuf,
70}
71
72pub struct UpdateReport {
74 pub sections_updated: Vec<String>,
75 pub dry_run: bool,
76}
77
78pub struct ValidateReport {
80 pub valid: bool,
81 pub missing_sections: Vec<String>,
82 pub outdated_sections: Vec<String>,
83}