ought_spec/config.rs
1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5/// Where on disk to find `.ought.md` spec files.
6///
7/// Owned by the spec crate because it is directly about spec discovery —
8/// the parser needs roots to walk. The aggregate `ought.toml` config lives
9/// in the CLI crate and composes this struct.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct SpecsConfig {
12 #[serde(default = "default_roots")]
13 pub roots: Vec<PathBuf>,
14}
15
16impl Default for SpecsConfig {
17 fn default() -> Self {
18 Self {
19 roots: default_roots(),
20 }
21 }
22}
23
24fn default_roots() -> Vec<PathBuf> {
25 vec![PathBuf::from("ought/")]
26}