pub struct Config {
pub severities: HashMap<RuleId, Severity>,
pub ignored_rules: Vec<RuleId>,
pub ignored_paths: GlobSet,
pub ignored_symbols: GlobSet,
pub constraint_rules: Vec<ConstraintRule>,
pub llm: LlmConfig,
}Expand description
Parsed spec-drift.toml.
Fields§
§severities: HashMap<RuleId, Severity>§ignored_rules: Vec<RuleId>§ignored_paths: GlobSet§ignored_symbols: GlobSet§constraint_rules: Vec<ConstraintRule>§llm: LlmConfigImplementations§
Source§impl Config
impl Config
Sourcepub fn load(path: &Path, source: ConfigSource) -> Result<Self, SpecDriftError>
pub fn load(path: &Path, source: ConfigSource) -> Result<Self, SpecDriftError>
Load a config from path. When source is ConfigSource::Discovered,
a missing file silently returns the default config. When Explicit, a
missing file is an error — the user asked for a specific config that
doesn’t exist.
Sourcepub fn discover(start: &Path) -> Option<PathBuf>
pub fn discover(start: &Path) -> Option<PathBuf>
Walk upward from start looking for a spec-drift.toml. Returns
Ok(None) if none is found.
Sourcepub fn is_suppressed(&self, d: &Divergence, root: &Path) -> bool
pub fn is_suppressed(&self, d: &Divergence, root: &Path) -> bool
True when this divergence should be dropped before reporting.
Sourcepub fn apply_severity_overrides(&self, divs: &mut [Divergence])
pub fn apply_severity_overrides(&self, divs: &mut [Divergence])
Apply [severity] overrides in place.
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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