pub struct Config {
pub triggers: Vec<String>,
pub fuse_days: u32,
pub exclude_patterns: Vec<String>,
pub extensions: Vec<String>,
pub fail_on_ticking: bool,
pub diff_files: Option<HashSet<PathBuf>>,
pub max_detonated: Option<usize>,
pub max_ticking: Option<usize>,
}Expand description
Fully-resolved configuration after merging the config file with CLI overrides.
Fields§
§triggers: Vec<String>§fuse_days: u32§exclude_patterns: Vec<String>§extensions: Vec<String>§fail_on_ticking: boolWhether to fail (exit 1) when ticking items are found (–fail-on-ticking).
diff_files: Option<HashSet<PathBuf>>If Some, only scan files whose relative path is in this set (–since git-diff mode). None means scan all files (normal mode).
max_detonated: Option<usize>Ratchet: fail if the number of detonated fuses exceeds this limit.
max_ticking: Option<usize>Ratchet: fail if the number of ticking fuses exceeds this limit.
Implementations§
Source§impl Config
impl Config
Sourcepub fn build_exclude_globset(&self) -> Result<GlobSet>
pub fn build_exclude_globset(&self) -> Result<GlobSet>
Build a GlobSet from the exclude patterns for fast path matching.
Sourcepub fn is_excluded(&self, path: &Path, globset: &GlobSet) -> bool
pub fn is_excluded(&self, path: &Path, globset: &GlobSet) -> bool
Return true if the given path should be excluded per exclude globs.
path should be relative to the scan root for glob matching to work correctly.
Sourcepub fn extension_allowed(&self, path: &Path) -> bool
pub fn extension_allowed(&self, path: &Path) -> bool
Return true if the file extension is in the allowed list. If the extensions list is empty, all files are considered eligible.
Sourcepub fn fuse_regex_pattern(&self) -> String
pub fn fuse_regex_pattern(&self) -> String
Build the fuse regex pattern from the configured triggers.
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
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>
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