pub struct Config {
pub generated: GlobSet,
pub not_generated: GlobSet,
pub attributes: Vec<String>,
pub grouping: GroupingConfig,
pub review: ReviewConfig,
pub keys: KeysConfig,
}Fields§
§generated: GlobSetAdditive globs marking files as generated (noise-tier hint).
not_generated: GlobSetOverrides: 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: GroupingConfigFrom the USER config, never the repo (agents differ per user).
review: ReviewConfigFrom the USER config: how much context the reviewer shows.
keys: KeysConfigFrom the USER config: which keys the reviewer’s actions answer to.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load<S: ConfigSource>(
src: &S,
repo_root: &Path,
repo_override: Option<&Path>,
user_override: Option<&Path>,
) -> Result<Config, EngineError>
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].
Sourcepub fn load_user<S: ConfigSource>(
src: &S,
user_override: Option<&Path>,
) -> Result<UserConfig, EngineError>
pub fn load_user<S: ConfigSource>( src: &S, user_override: Option<&Path>, ) -> Result<UserConfig, EngineError>
The USER file alone: [grouping], [review] and [keys], and no
repository.
load needs a repository root to find the repo file.
dfr agents has none — which agent you would run is a per-user choice
and the question is answerable from anywhere. Rather than hand it a
directory it has no use for, the user half is its own call, and load
goes through it so there is one answer to “where does the user file
live”.
A missing file means defaults; a malformed one is a hard error.
Sourcepub fn parse(text: &str, origin: &str) -> Result<Config, EngineError>
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.
Sourcepub fn parse_user(text: &str, origin: &str) -> Result<UserConfig, EngineError>
pub fn parse_user(text: &str, origin: &str) -> Result<UserConfig, EngineError>
Parse the USER file: [grouping], [review] and [keys].
Source§impl Config
impl Config
Sourcepub fn render_user(user: &UserConfig) -> String
pub fn render_user(user: &UserConfig) -> String
The user file as TOML, whole. What save_user
writes: every [review] value, the [grouping] values that are set,
and [keys] only when an action is rebound.
Sourcepub fn save_user<S: ConfigSource>(
src: &S,
path: &Path,
user: &UserConfig,
) -> Result<(), EngineError>
pub fn save_user<S: ConfigSource>( src: &S, path: &Path, user: &UserConfig, ) -> Result<(), EngineError>
Write the user file at path, REPLACING it (ADR 0037).
Whole-file on purpose: the reviewer’s config modal edits every setting, and a rewrite is the one form that cannot disagree with what it shows. The cost is the file’s comments and layout, which the modal says before it saves.
The text is parsed back before it is written, so the file on disk is
always one parse_user accepts, and accepts as
this value.