Skip to main content

tokmd_settings/
profile.rs

1//! Legacy profile configuration contracts.
2
3use std::collections::BTreeMap;
4
5use serde::{Deserialize, Serialize};
6use tokmd_types::RedactMode;
7
8// Legacy profile contract persisted by the historical `config.json` format.
9//
10// These types are intentionally kept in `tokmd-settings` so that the config
11// profile contract is available without CLI parsing dependencies.
12
13/// Legacy profile map used by historical `config.json` files.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct UserConfig {
16    pub profiles: BTreeMap<String, Profile>,
17    pub repos: BTreeMap<String, String>, // "owner/repo" -> "profile_name"
18}
19
20/// Legacy profile options shared by configuration consumers.
21#[derive(Debug, Clone, Default, Serialize, Deserialize)]
22pub struct Profile {
23    // Shared
24    pub format: Option<String>, // "json", "md", "tsv", "csv", "jsonl"
25    pub top: Option<usize>,
26
27    // Lang
28    pub files: Option<bool>,
29
30    // Module / Export
31    pub module_roots: Option<Vec<String>>,
32    pub module_depth: Option<usize>,
33    pub min_code: Option<usize>,
34    pub max_rows: Option<usize>,
35    pub redact: Option<RedactMode>,
36    pub meta: Option<bool>,
37
38    // "children" can be ChildrenMode or ChildIncludeMode string
39    pub children: Option<String>,
40}