pub struct DepCheck { /* private fields */ }Expand description
Configuration for a dependency check.
§Example
use dev_deps::{DepCheck, DepScope};
use dev_report::Severity;
let check = DepCheck::new("my-crate", "0.1.0")
.scope(DepScope::All)
.workspace()
.allow("legacy-shim")
.severity_threshold(Severity::Warning)
.escalate_at_majors(3);
let _result = check.execute().unwrap();Implementations§
Source§impl DepCheck
impl DepCheck
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
Begin a new dependency check.
name and version are descriptive — they identify the subject
in the produced Report.
Sourcepub fn scope(self, scope: DepScope) -> Self
pub fn scope(self, scope: DepScope) -> Self
Pick which checks to run. Defaults to DepScope::All.
Sourcepub fn in_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn in_dir(self, dir: impl Into<PathBuf>) -> Self
Run the subprocesses from dir instead of the current directory.
Sourcepub fn exclude(self, pattern: impl Into<String>) -> Self
pub fn exclude(self, pattern: impl Into<String>) -> Self
Exclude a crate from both scanners. May be called multiple times.
Sourcepub fn allow(self, crate_name: impl Into<String>) -> Self
pub fn allow(self, crate_name: impl Into<String>) -> Self
Suppress findings against a specific crate name. Matches both
unused and outdated findings on crate_name.
Sourcepub fn severity_threshold(self, threshold: Severity) -> Self
pub fn severity_threshold(self, threshold: Severity) -> Self
Discard findings whose severity is below threshold. Findings
at or above the threshold are kept.
Sourcepub fn escalate_at_majors(self, n: u32) -> Self
pub fn escalate_at_majors(self, n: u32) -> Self
Escalate outdated findings to a failing check when the crate
is at least n major versions behind. By default, outdated
findings produce only Warn-verdict checks.
Sourcepub fn subject_version(&self) -> &str
pub fn subject_version(&self) -> &str
Subject version passed in via new.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DepCheck
impl RefUnwindSafe for DepCheck
impl Send for DepCheck
impl Sync for DepCheck
impl Unpin for DepCheck
impl UnsafeUnpin for DepCheck
impl UnwindSafe for DepCheck
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