From 2d1174266de219fd5ab5e70c4ff040be15535ee2 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 17:31:13 -0300 Subject: [PATCH] feat: add default boolean options for text plugin statistics Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/meta_plugin/text.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/meta_plugin/text.rs b/src/meta_plugin/text.rs index a1c1614..59679c5 100644 --- a/src/meta_plugin/text.rs +++ b/src/meta_plugin/text.rs @@ -48,10 +48,20 @@ impl TextMetaPlugin { outputs, ); - // Set default text_detect_size option if not provided - if !base.options.contains_key("text_detect_size") { - base.options.insert("text_detect_size".to_string(), - serde_yaml::Value::Number(PIPESIZE.into())); + // Set default options if not provided + let default_options = vec![ + ("text_detect_size", serde_yaml::Value::Number(PIPESIZE.into())), + ("text_word_count", serde_yaml::Value::Bool(true)), + ("text_line_count", serde_yaml::Value::Bool(true)), + ("text_line_max_len", serde_yaml::Value::Bool(true)), + ("text_line_mean_len", serde_yaml::Value::Bool(true)), + ("text_line_median_len", serde_yaml::Value::Bool(false)), + ]; + + for (key, value) in default_options { + if !base.options.contains_key(key) { + base.options.insert(key.to_string(), value); + } } // Get text_detect_size (previously max_buffer_size)