Skip to main content

Options

Struct Options 

Source
#[non_exhaustive]
pub struct Options {
Show 16 fields pub long_window_secs: i64, pub recent_window_secs: i64, pub reference: String, pub full_history: bool, pub include_merges: bool, pub follow_renames: bool, pub exclude_bots: bool, pub bot_pattern: String, pub as_of: Option<i64>, pub risk_formula: RiskFormula, pub emit_author_details: bool, pub author_hash_key: Option<AuthorHashKey>, pub include_deleted: bool, pub compute_bus_factor: bool, pub bus_factor_threshold: f64, pub file_types: FileTypeScope,
}
Available on crate feature vcs-git only.
Expand description

Configuration for a single change-history walk.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§long_window_secs: i64

Long observation window, in seconds (default ≈ 365 days).

§recent_window_secs: i64

Recent observation window, in seconds (default 90 days).

§reference: String

Revision to start the walk from (default HEAD).

§full_history: bool

Walk the full commit DAG rather than first-parent only.

§include_merges: bool

Include merge commits (default: skip them).

§follow_renames: bool

Follow file renames across history (default: on).

§exclude_bots: bool

Exclude bot author identities (default: on).

§bot_pattern: String

Regex matched against author name/email to detect bots.

§as_of: Option<i64>

Reference “now” as a Unix timestamp for reproducible snapshots (--as-of). None means wall-clock time at walk start.

§risk_formula: RiskFormula

Which composite score to compute.

§emit_author_details: bool

Emit SHA-256-hashed canonical author identities (default: off — author identities never leave the process otherwise).

§author_hash_key: Option<AuthorHashKey>

Optional secret key that hardens emit_author_details into a keyed HMAC (issue #956). None (the default) emits the bare SHA-256 pseudonym. Has no effect unless emit_author_details is set. The key is a finalization-time concern (like emit_author_details itself), so it never enters the persistent-cache fingerprint: the same cached walk re-finalizes under any key without a re-walk (see AuthorId::emit_hashed).

§include_deleted: bool

Emit stats for files deleted at the target ref (default: off).

§compute_bus_factor: bool

Compute the directory- / repo-level bus-factor aggregate from the walk (issue #332). Default off: it retains per-file authorship beyond the per-file Stats, which the repeated JIT-prior and per-file-injection walks neither need nor should pay for.

§bus_factor_threshold: f64

Coverage (abandonment) threshold for the bus factor, in (0, 1) — the fraction of files that must be orphaned for the greedy removal to stop (default DEFAULT_BUS_FACTOR_THRESHOLD, 0.5 per Avelino). Ignored unless compute_bus_factor is set.

§file_types: FileTypeScope

Which tracked files to rank (issue #576). Defaults to FileTypeScope::Metrics — only files bca has metrics for — so high-churn non-source files do not dominate the risk ranking and the change-history view aligns with the AST hotspot tables.

Implementations§

Source§

impl Options

Source

pub fn long_window_days(&self) -> u32

Long window expressed in whole days (for the serialized long_window_days field and the new_file/age cap).

Source

pub fn recent_window_days(&self) -> u32

Recent window expressed in whole days.

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Options

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.