pub struct Config {
pub plugins: HashMap<String, PluginConfig>,
pub exclude: Vec<String>,
pub debt_weights: DebtWeights,
pub strictness: Strictness,
pub languages: HashMap<String, LanguageConfig>,
}Expand description
Top-level config from .cha.toml.
Fields§
§plugins: HashMap<String, PluginConfig>§exclude: Vec<String>Glob patterns for paths to exclude from analysis.
debt_weights: DebtWeightsCustom remediation time weights (minutes per severity).
strictness: StrictnessThreshold scaling factor.
languages: HashMap<String, LanguageConfig>Per-language plugin overrides.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(dir: &Path) -> Self
pub fn load(dir: &Path) -> Self
Load config from .cha.toml in the given directory, or return default.
Sourcepub fn load_for_file(file_path: &Path, project_root: &Path) -> Self
pub fn load_for_file(file_path: &Path, project_root: &Path) -> Self
Load merged config for a specific file by walking up from its directory to root. Child configs override parent configs (child-wins merge).
Sourcepub fn merge(&mut self, other: Config)
pub fn merge(&mut self, other: Config)
Merge another config into self. other values take precedence.
Sourcepub fn resolve_for_language(&self, language: &str) -> Config
pub fn resolve_for_language(&self, language: &str) -> Config
Produce a resolved config for a specific language. Applies builtin language profile first, then user overrides.
Sourcepub fn is_enabled(&self, name: &str) -> bool
pub fn is_enabled(&self, name: &str) -> bool
Check if a plugin is enabled (default: true if not mentioned).
Sourcepub fn get_usize(&self, plugin: &str, key: &str) -> Option<usize>
pub fn get_usize(&self, plugin: &str, key: &str) -> Option<usize>
Get a usize option for a plugin, scaled by strictness factor.
Sourcepub fn get_str(&self, plugin: &str, key: &str) -> Option<String>
pub fn get_str(&self, plugin: &str, key: &str) -> Option<String>
Get a string option for a plugin.
Sourcepub fn set_strictness(&mut self, s: Strictness)
pub fn set_strictness(&mut self, s: Strictness)
Override strictness (e.g. from CLI –strictness flag).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more