Struct DefectOracle
pub struct DefectOracle { /* private fields */ }Expand description
A pure fix-commit classifier over a commit message.
A commit is a fix iff its message matches, case-insensitively, either:
- a conventional-commit prefix
fix:/fix(scope):anchored to the start of the message, or - a defect-vocabulary term at word boundaries:
bug,fix/fixes/fixed,defect,regression,hotfixare matched as whole words (\b…\bon both sides —fixture,hotfixture,defective,affixnever count), whilebugfixalone is leading-boundary-only so its plural compoundbugfixesstill counts,
AND the caller-supplied is_merge flag is false, AND the message does not
begin with the literal git revert prefix Revert ".
extra_patterns from OracleConfig are additional regexes OR’d into the
classification, compiled once here in DefectOracle::new.
Deliberately separate from kamei::enrich_fix’s \b(bug|fix|fixes|fixed| defect|patch|hotfix|issue|error)\b — that regex is a JIT-SDP feature input
left untouched; its broader alternation (patch, issue, error) is a
documented SZZ precision trap this oracle deliberately narrows.
Implementations§
§impl DefectOracle
impl DefectOracle
pub fn new(cfg: &OracleConfig) -> Result<Self>
pub fn new(cfg: &OracleConfig) -> Result<Self>
Compile the built-in classifiers plus cfg.extra_patterns.
§Errors
CodeLoreError::InvalidOptions when an entry in extra_patterns is
not a valid regex — a configuration mistake, not a degradable state.
Trait Implementations§
§impl Clone for DefectOracle
impl Clone for DefectOracle
§fn clone(&self) -> DefectOracle
fn clone(&self) -> DefectOracle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DefectOracle
impl RefUnwindSafe for DefectOracle
impl Send for DefectOracle
impl Sync for DefectOracle
impl Unpin for DefectOracle
impl UnsafeUnpin for DefectOracle
impl UnwindSafe for DefectOracle
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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