Skip to repository content28 lines · 863 B · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T08:09:06.957Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
settings.rs
1use anyhow::Result;
2use serde_json::Value;
3
4use crate::migrations::migrate_language_setting;
5
6pub fn make_auto_indent_an_enum(value: &mut Value) -> Result<()> {
7 migrate_language_setting(value, migrate_auto_indent)
8}
9
10fn migrate_auto_indent(value: &mut Value, _path: &[&str]) -> Result<()> {
11 let Some(auto_indent) = value
12 .as_object_mut()
13 .and_then(|obj| obj.get_mut("auto_indent"))
14 else {
15 return Ok(());
16 };
17
18 *auto_indent = match auto_indent {
19 Value::Bool(true) => Value::String("syntax_aware".to_string()),
20 Value::Bool(false) => Value::String("none".to_string()),
21 Value::String(s) if s == "syntax_aware" || s == "preserve_indent" || s == "none" => {
22 return Ok(());
23 }
24 _ => anyhow::bail!("Expected auto_indent to be a boolean or valid enum value"),
25 };
26 Ok(())
27}
28