pub struct CodebookConfig {
pub cache_dir: PathBuf,
/* private fields */
}Fields§
§cache_dir: PathBufDirectory for caching
Implementations§
Source§impl CodebookConfig
impl CodebookConfig
Sourcepub fn load(current_dir: Option<&Path>) -> Result<Self, Error>
pub fn load(current_dir: Option<&Path>) -> Result<Self, Error>
Load configuration by searching for both global and project-specific configs
Sourcepub fn snapshot(&self) -> Arc<ConfigSettings>
pub fn snapshot(&self) -> Arc<ConfigSettings>
Get current configuration snapshot (cheap to clone)
Sourcepub fn reload(&self) -> Result<bool, Error>
pub fn reload(&self) -> Result<bool, Error>
Reload both global and project configurations, only reading files if they’ve changed
Sourcepub fn add_word(&self, word: &str) -> Result<bool, Error>
pub fn add_word(&self, word: &str) -> Result<bool, Error>
Add a word to the project configs allowlist
Sourcepub fn add_word_global(&self, word: &str) -> Result<bool, Error>
pub fn add_word_global(&self, word: &str) -> Result<bool, Error>
Add a word to the global configs allowlist
Sourcepub fn save_global(&self) -> Result<(), Error>
pub fn save_global(&self) -> Result<(), Error>
Save the global configuration to its file
Sourcepub fn get_dictionary_ids(&self) -> Vec<String>
pub fn get_dictionary_ids(&self) -> Vec<String>
Get dictionary IDs from effective configuration
Sourcepub fn should_ignore_path<P: AsRef<Path>>(&self, path: P) -> bool
pub fn should_ignore_path<P: AsRef<Path>>(&self, path: P) -> bool
Check if a path should be ignored based on the effective configuration
Sourcepub fn is_allowed_word(&self, word: &str) -> bool
pub fn is_allowed_word(&self, word: &str) -> bool
Check if a word is in the effective allowlist
Sourcepub fn should_flag_word(&self, word: &str) -> bool
pub fn should_flag_word(&self, word: &str) -> bool
Check if a word should be flagged according to effective configuration
Sourcepub fn get_ignore_patterns(&self) -> Option<Vec<Regex>>
pub fn get_ignore_patterns(&self) -> Option<Vec<Regex>>
Get the list of user-defined ignore patterns
Sourcepub fn get_min_word_length(&self) -> usize
pub fn get_min_word_length(&self) -> usize
Get the minimum word length which should be checked
Sourcepub fn clean_cache(&self)
pub fn clean_cache(&self)
Clean the cache directory
Sourcepub fn project_config_path(&self) -> Option<PathBuf>
pub fn project_config_path(&self) -> Option<PathBuf>
Get path to project config if it exists
Sourcepub fn global_config_path(&self) -> Option<PathBuf>
pub fn global_config_path(&self) -> Option<PathBuf>
Get path to global config if it exists