Struct NewCodeGates
pub struct NewCodeGates {
pub window_days: u32,
pub born_health_min: Option<f64>,
pub touched_no_degradation: bool,
}Expand description
The [new_code] section: a two-band, period-scoped quality gate over the
active working set.
- Born in window — a file first seen inside the rolling
window_dayswindow must meetborn_health_minat HEAD. This generalises the[diff]new_file_health_minfloor from PR scope to period scope. - Touched in window — a file touched (but not born) inside the window
owes non-negative net health movement over the window when
touched_no_degradationis on (the default). The signal is the same per-file net-movement the improving-churn effort exemption computes, here required to be non-degrading rather than strictly improving. - Untouched — legacy files nobody edited in the window are exempt; only
the absolute
[gates]apply to them.
The section is opt-in: its presence (any key, or none) enables the gate
and makes the thresholds file non-empty. Absence is byte-identical to the
behaviour without this feature. The PR-scoped new_file_health_min and this
period-scoped floor are complementary and both stay: the former answers “is
this pull request acceptable now”, the latter “is the working set healthy”.
Fields§
§window_days: u32Rolling window, in days, defining the active working set. Anchored to the
repo’s most recent commit date (not wall-clock), so the born/touched
partition is reproducible on archived repos. Defaults to
DEFAULT_WINDOW_DAYS — the same
window the effort-exposure view uses, so both describe one working set.
born_health_min: Option<f64>Floor a file born inside the window must meet at HEAD, on the [0, 100]
code-health scale. Absent ⇒ the born band is not evaluated (only the
touched band applies).
touched_no_degradation: boolWhen true (the default once the section is present), a file
touched but not born inside the window fails if its net health movement
over the window is negative. A window that touched a file without moving
any function across a delta-health risk band (a typo fix, a comment edit)
nets zero and passes. Set false to keep the born band while dropping the
touched band.
Trait Implementations§
§impl Clone for NewCodeGates
impl Clone for NewCodeGates
§fn clone(&self) -> NewCodeGates
fn clone(&self) -> NewCodeGates
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for NewCodeGates
impl Debug for NewCodeGates
§impl Default for NewCodeGates
impl Default for NewCodeGates
§impl<'de> Deserialize<'de> for NewCodeGates
impl<'de> Deserialize<'de> for NewCodeGates
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for NewCodeGates
impl RefUnwindSafe for NewCodeGates
impl Send for NewCodeGates
impl Sync for NewCodeGates
impl Unpin for NewCodeGates
impl UnsafeUnpin for NewCodeGates
impl UnwindSafe for NewCodeGates
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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