Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 25 fields pub idle_days: u64, pub check_interval_days: u64, pub auto_daemon: bool, pub auto_hooks: bool, pub auto_setup: bool, pub auto_config: bool, pub require_confirmation: bool, pub command_timeout_secs: u64, pub min_size_mb: u64, pub update_check: bool, pub scan_depth: usize, pub allow_manifest_rewrite: bool, pub update_check_interval_days: i64, pub update_check_timeout_secs: u64, pub auto_hooks_chain: bool, pub enable_cargo: bool, pub enable_gradle: bool, pub enable_maven: bool, pub enable_swift: bool, pub enable_dart: bool, pub enable_mix_build: bool, pub build_idle_days: u64, pub auto_update: bool, pub disabled_adapters: Vec<String>, pub adapter_idle_days: BTreeMap<String, u64>,
}
Expand description

Global settings that control prune behavior.

Fields§

§idle_days: u64

Number of inactive days before a repo is eligible for pruning.

§check_interval_days: u64

Interval in days between automated daemon checks.

§auto_daemon: bool

Whether the setup pass installs the OS scheduler. On by default.

§auto_hooks: bool

Whether the setup pass installs the global Git hooks. On by default.

§auto_setup: bool

Whether dev-prune installs its own missing integrations. On by default.

§auto_config: bool

Whether link and init write a default .devprune.json into repositories they register. Off by default; see constants::DEFAULT_AUTO_CONFIG.

§require_confirmation: bool

Whether interactive confirmation is required before pruning.

§command_timeout_secs: u64

Timeout in seconds for lockfile enforcement / CLI commands (default 600s = 10m).

§min_size_mb: u64

Smallest bloat directory worth deleting, in MiB. 0 disables the floor.

Below this size the reinstall costs more than the space is worth, so the directory is not offered as a candidate at all.

§update_check: bool

Whether dev-prune asks GitHub for the latest release from time to time.

On by default, and opt-out rather than opt-in: an out-of-date cleanup tool is a tool whose safety fixes you do not have. The request sends nothing but itself — no identifier, no configuration, no usage data. Turn it off with devp config set update_check false.

§scan_depth: usize

How many directory levels below a repository root discovery descends.

Six by default. A flat repository never notices; a monorepo that nests projects under packages/@scope/name/app does. Raise it when devp status does not list a project you know is there, and remember that the walk gets more expensive with every level. Clamped to constants::MAX_SCAN_DEPTH_LIMIT.

§allow_manifest_rewrite: bool

Whether cargo and go may run the sync command that rewrites tracked manifests.

Off. See constants::DEFAULT_ALLOW_MANIFEST_REWRITE — with this off, both are verified read-only and a project with no lockfile at all is simply not pruned.

§update_check_interval_days: i64

Days between automatic release checks.

Only the automatic check honours this; devp update always asks, because you are standing there waiting for the answer.

§update_check_timeout_secs: u64

How long the release check waits for GitHub before giving up, in seconds.

Five is right on a normal connection and too short behind some corporate proxies, which is the whole reason this is a setting rather than a constant.

§auto_hooks_chain: bool

Whether the setup pass may install the Git hooks in front of another tool’s.

Off. With it on, a core.hooksPath that belongs to husky is not a reason to skip: dev-prune takes the slot and forwards every hook back to the directory it displaced. Behaviour-preserving, but it is still someone else’s setup, so it is asked for rather than assumed. Same thing as devp hook install --chain.

§enable_cargo: bool

Whether the opt-in Cargo adapter is active. Off by default, and the reason is the same one that keeps enable_gradle off: Rust’s target/ is compiler output. cargo metadata --locked proves the crates come back from Cargo.lock, but nothing downloads a compiled artefact — the directory returns only by rebuilding, which on a large workspace is minutes rather than the seconds a dependency reinstall costs. See crate::adapters::cargo_adapter.

§enable_gradle: bool

Whether the opt-in Gradle build-tool adapter is active. Off by default: build/ comes back by recompiling the project, so nobody should find it deleted without having asked. See crate::adapters::gradle.

§enable_maven: bool

Whether the opt-in Maven build-tool adapter is active. Off by default, for the same reason as enable_gradle. See crate::adapters::maven.

§enable_swift: bool

Whether the opt-in Swift Package Manager adapter is active. Off by default, for the same reason as enable_gradle: .build/ holds compiled modules and comes back through swift build. See crate::adapters::swift.

§enable_dart: bool

Whether the opt-in Dart and Flutter adapter is active. Off by default: the pub metadata in .dart_tool/ is a second’s work to restore, but the build_runner and flutter_build caches beside it are compiler output and come back only by recompiling. See crate::adapters::dart.

§enable_mix_build: bool

Whether the opt-in Mix build-tree adapter is active. Off by default, and separate from the always-on mix adapter: that one deletes deps/, which comes back by downloading, while _build/ comes back only by recompiling the project and every dependency in it. See crate::adapters::mix_build.

§build_idle_days: u64

Idle days required before build-tree directories (cargo, gradle, maven, swift) are pruned.

Separate from idle_days because the cost of being wrong is different: a deleted node_modules is one npm ci away, a deleted Android build/ is a long recompile. Applied as max(build_idle_days, idle_days).

§auto_update: bool

Whether a newer release installs itself at the end of a prune pass, once the periodic check has found one.

On by default. A pruner that runs on a schedule is exactly the kind of tool nobody thinks to upgrade, and an old one keeps whatever bug it shipped with forever. What runs here is the download-and-replace half only: see crate::commands::update::maybe_auto_update, which never hands the machine to a package manager unattended and stands aside entirely on WinGet, Scoop and Homebrew, where the manager owns the upgrade.

§disabled_adapters: Vec<String>

Adapters switched off by name, whatever their lockfiles say.

A deny-list rather than twenty enable_* booleans, because the answer for almost everyone is “none of them” and a list of exceptions says that in one place. It is a preference, and the opposite of enable_gradle and friends: those are off until asked for because deleting a build tree is expensive to undo, whereas node_modules is safe to prune and merely something a particular person may not want touched.

Names are the adapter names --only/--skip take. Applied in crate::adapters::detect_adapters, so a disabled adapter is invisible to every command at once rather than listed by status and skipped by run.

§adapter_idle_days: BTreeMap<String, u64>

Per-adapter idle windows, in days, keyed by adapter name.

The one dial that is neither global nor per-repository: “wait longer before touching Rust” is a statement about a toolchain, not about one checkout, and before this it could only be said by moving the global window for everything.

A floor, never a bypass. The value is applied as max(idle_days, adapter_idle_days[name]), so it can only make an adapter wait longer than the repository-level check already requires. A smaller number is accepted and simply has no effect — the repository gate runs first and is the same gate for every adapter, and letting one adapter lower it would be a bypass of the idle check rather than a preference.

BTreeMap rather than HashMap so the JSON round-trips in a stable order and a diff of the registry file shows what actually changed.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

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 Settings

Source§

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

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

impl Default for Settings

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Settings

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 Settings

Source§

fn eq(&self, other: &Settings) -> 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 Settings

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 Settings

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 = Infallible

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.