Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub generated: GlobSet,
    pub not_generated: GlobSet,
    pub attributes: Vec<String>,
    pub grouping: GroupingConfig,
    pub review: ReviewConfig,
}

Fields§

§generated: GlobSet

Additive globs marking files as generated (noise-tier hint).

§not_generated: GlobSet

Overrides: never mark these generated. Wins over everything.

§attributes: Vec<String>

gitattributes attribute names honoured as “generated” declarations. Defaults to DEFAULT_ATTRIBUTES; setting the key replaces the list rather than adding to it.

§grouping: GroupingConfig

From the USER config, never the repo (agents differ per user).

§review: ReviewConfig

From the USER config: how much context the reviewer shows.

Implementations§

Source§

impl Config

Source

pub fn load<S: ConfigSource>( src: &S, repo_root: &Path, repo_override: Option<&Path>, user_override: Option<&Path>, ) -> Result<Config, EngineError>

Resolution, per file: explicit path > default location > defaults. A missing file means defaults; a malformed file is a hard error, never silently ignored.

Repo file: <repo-root>/.differential.toml — classification hints. User file: ~/.config/differential/config.toml — [grouping].

Source

pub fn parse(text: &str, origin: &str) -> Result<Config, EngineError>

Parse the REPO file: classification hints only. A [grouping] table here is a hard error with a pointer to its new home.

Source

pub fn parse_user(text: &str, origin: &str) -> Result<UserConfig, EngineError>

Parse the USER file: [grouping] and [review].

Trait Implementations§

Source§

impl Debug for Config

Source§

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

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

impl Default for Config

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.