Skip to main content

Module config

Module config 

Source
Expand description

Configuration, split by ownership (ADR 0012, amended by ADR 0018-era split):

  • Repo-level .differential.toml at the target repo’s root — classification hints only. Shared by everyone reviewing the repo.
  • User-level ~/.config/differential/config.toml (XDG) — [grouping]: which agent CLI to run and its timeout, and [review]: which palette the reviewer wears, how much context it shows around a hunk, and which diff layout it opens in, and [keys]: which keys the reviewer’s actions answer to. All per-user choices, not properties of the repo, so none of them lives in it.

HARD RULE (ADR 0012): config tunes classification hints and tool behaviour. It can never remove a file or hunk from enumeration — enumeration runs before and independently of anything in this module, and nothing here is consulted by the parser or the invariants.

Structs§

Config
EditorCommand
A parsed [review].editor — the command that opens a file at a line.
GroupingConfig
[grouping] — pure data; the application layer turns it into an LLM backend (ADR 0018, 0020).
KeysConfig
[keys] — which keys an action answers to, as the reader wrote them.
ReviewConfig
[review] — how the terminal reviewer looks, and how much of a file it shows around a hunk.
UserConfig
Everything parse_user reads, so load assigns one value rather than growing a second assignment every time the user file gains a table.

Enums§

Action
Something the terminal reviewer does on a key, by name (ADR 0036).
Agent
Which agent to run, by name.
DiffLayout
How the reviewer lays a hunk out.
ReadOnly
What keeps an agent from writing.
ThemeName
Which palette the terminal reviewer wears, by name.

Constants§

CONFIG_FILE_NAME
DEFAULT_ATTRIBUTES
gitattributes names honoured as a “generated” declaration when [classify].attributes is absent.
DEFAULT_TIMEOUT_SECS
How long a grouping call may run when [grouping].timeout_secs is unset. Every agent’s backend starts from it.
EDITOR_FILE
The placeholder standing for the path to open.
EDITOR_LINE
The placeholder standing for the line to open it at.
USER_CONFIG_DIR
USER_CONFIG_FILE_NAME

Functions§

user_config_path
<user config dir>/differential/config.toml.