Skip to main content

PerRepoConfig

Struct PerRepoConfig 

Source
pub struct PerRepoConfig {
    pub schema: String,
    pub project_name: Option<String>,
    pub ignore: bool,
    pub disable_hooks: bool,
    pub disable_daemon: bool,
    pub override_idle_days: Option<u64>,
    pub min_size_mb: Option<u64>,
    pub scan_depth: Option<usize>,
    pub prunable: Option<Prunable>,
}
Expand description

Structured per-repository configuration file stored inside repo roots as .devprune.json.

Fields§

§schema: String

JSON Schema reference URL for IDE IntelliSense and validation.

§project_name: Option<String>

Custom display name for this project in TUI and CLI status views.

§ignore: bool

Whether this repository is ignored/excluded from pruning.

§disable_hooks: bool

Disable global Git auto-registration hooks for this specific workspace.

§disable_daemon: bool

Disable background daemon automated pruning pass for this specific workspace.

§override_idle_days: Option<u64>

Custom override for idle days threshold (overrides global settings).

§min_size_mb: Option<u64>

Custom override for the size floor, in MiB (overrides global min_size_mb).

Some(0) is a meaningful value: it turns the floor off for this repository even when a global floor is set.

§scan_depth: Option<usize>

Custom override for how deep discovery walks this repository.

The setting that most often needs to differ per repository rather than globally: one deeply-nested monorepo should not make every other repository pay for a deeper walk. Clamped to constants::MAX_SCAN_DEPTH_LIMIT like the global one.

§prunable: Option<Prunable>

What this project declares prunable beyond what an adapter can recognise.

Implementations§

Source§

impl PerRepoConfig

Source

pub fn load_with_diagnostics(repo_path: &Path) -> Result<Option<Self>, String>

Load per-repo config from .devprune.json, or None when there is no such file.

This is the only loader. There used to be a second one that returned None for a file that failed to parse as well as for one that was absent, and every caller of it then went on to act as though the repository had no configuration: the prune pass ignored an "ignore": true it could not read, and the two workspace toggles wrote a fresh default file straight over the user’s broken one, taking every override in it with them. A caller that genuinely does not care — the display-name lookup — says so with .ok().flatten().

Source

pub fn save_to_repo(&self, repo_path: &Path) -> Result<()>

Save per-repo config to .devprune.json in the repo root, and record it in the repository’s .git/info/exclude so it never shows up in git status.

Source

pub fn broken_files(repo_path: &Path) -> Vec<(&'static str, String)>

Which of a repository’s config files exist and do not parse, and why.

load_with_diagnostics collapses both into one refusal, which is the right answer for every reader: a config that cannot be read is a repository dev-prune will not touch, whichever file it was in. devp doctor is the one caller that has to know which, because it repairs the personal file by renaming it aside and must never do that to a file the user has committed.

Source

pub fn load_personal_for_write(repo_path: &Path) -> Result<Option<Self>, String>

The personal .devprune.json alone, for a caller about to write it back.

load_with_diagnostics answers “what is in force here”, which is the merge of both files and the right answer for everything that reads. It is the wrong answer for anything that writes: saving it copies the project file’s values into the personal one, and the next edit to the project file leaves that copy behind, silently overriding the file it was copied from.

Trait Implementations§

Source§

impl Clone for PerRepoConfig

Source§

fn clone(&self) -> PerRepoConfig

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 PerRepoConfig

Source§

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

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

impl Default for PerRepoConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for PerRepoConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PerRepoConfig

Source§

fn eq(&self, other: &PerRepoConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PerRepoConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PerRepoConfig

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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 = !

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.