From d2d7d570d967e360f5073020f46559326d118291 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 6 Sep 2025 23:31:38 +0800 Subject: [PATCH] ci: enable Dependabot --- .github/dependabot.yml | 15 ++++++++++++++ yazi-actor/src/lives/task.rs | 1 - yazi-binding/src/url.rs | 2 +- yazi-plugin/preset/components/tasks.lua | 2 +- yazi-scheduler/src/file/progress.rs | 10 +++++----- yazi-scheduler/src/plugin/progress.rs | 2 +- yazi-scheduler/src/prework/progress.rs | 6 +++--- yazi-scheduler/src/process/progress.rs | 6 +++--- yazi-scheduler/src/progress.rs | 26 ++++++++++++------------- yazi-scheduler/src/scheduler.rs | 2 +- 10 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..bff47538 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" + + - package-ecosystem: "npm" + directory: "/scripts/validate-form" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" diff --git a/yazi-actor/src/lives/task.rs b/yazi-actor/src/lives/task.rs index fd69946f..12b5f560 100644 --- a/yazi-actor/src/lives/task.rs +++ b/yazi-actor/src/lives/task.rs @@ -32,7 +32,6 @@ impl UserData for TaskSnap { fields.add_field_method_get("running", |_, me| Ok(me.prog.running())); fields.add_field_method_get("success", |_, me| Ok(me.prog.success())); - fields.add_field_method_get("cleaning", |_, me| Ok(me.prog.cleaning())); fields.add_field_method_get("percent", |_, me| Ok(me.prog.percent())); } } diff --git a/yazi-binding/src/url.rs b/yazi-binding/src/url.rs index 7e8182eb..6135d56d 100644 --- a/yazi-binding/src/url.rs +++ b/yazi-binding/src/url.rs @@ -1,7 +1,7 @@ use std::ops::Deref; use mlua::{AnyUserData, ExternalError, FromLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, UserDataRef, Value}; -use yazi_shared::{IntoOsStr, url::{UrlBufCov, UrlCow}}; +use yazi_shared::{IntoOsStr, url::UrlCow}; use crate::{Urn, cached_field, deprecate}; diff --git a/yazi-plugin/preset/components/tasks.lua b/yazi-plugin/preset/components/tasks.lua index c85d6bf3..1976b72e 100644 --- a/yazi-plugin/preset/components/tasks.lua +++ b/yazi-plugin/preset/components/tasks.lua @@ -75,7 +75,7 @@ function Tasks:progress_redraw(snap, y) local kind = snap.prog.kind if kind == "FilePaste" or kind == "FileDelete" then local percent - if snap.cleaning then + if snap.success then percent = "Cleaning…" else percent = string.format("%3d%%", math.floor(snap.percent)) diff --git a/yazi-scheduler/src/file/progress.rs b/yazi-scheduler/src/file/progress.rs index 74a51b01..4486db54 100644 --- a/yazi-scheduler/src/file/progress.rs +++ b/yazi-scheduler/src/file/progress.rs @@ -31,7 +31,7 @@ impl FileProgPaste { pub fn success(self) -> bool { self.collected && self.success_files == self.total_files } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { Some(if self.success() { @@ -66,7 +66,7 @@ impl FileProgLink { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -96,7 +96,7 @@ impl FileProgHardlink { pub fn success(self) -> bool { self.collected && self.success == self.total } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -131,7 +131,7 @@ impl FileProgDelete { pub fn success(self) -> bool { self.collected && self.success_files == self.total_files } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { Some(if self.success() { @@ -166,7 +166,7 @@ impl FileProgTrash { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/plugin/progress.rs b/yazi-scheduler/src/plugin/progress.rs index e1d4b27b..b22ff85c 100644 --- a/yazi-scheduler/src/plugin/progress.rs +++ b/yazi-scheduler/src/plugin/progress.rs @@ -23,7 +23,7 @@ impl PluginProgEntry { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/prework/progress.rs b/yazi-scheduler/src/prework/progress.rs index a0709663..91200ff4 100644 --- a/yazi-scheduler/src/prework/progress.rs +++ b/yazi-scheduler/src/prework/progress.rs @@ -23,7 +23,7 @@ impl PreworkProgFetch { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -50,7 +50,7 @@ impl PreworkProgLoad { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -77,7 +77,7 @@ impl PreworkProgSize { pub fn success(self) -> bool { self.done } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/process/progress.rs b/yazi-scheduler/src/process/progress.rs index d75938f6..e4ddc657 100644 --- a/yazi-scheduler/src/process/progress.rs +++ b/yazi-scheduler/src/process/progress.rs @@ -24,7 +24,7 @@ impl ProcessProgBlock { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } @@ -52,7 +52,7 @@ impl ProcessProgOrphan { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } @@ -80,7 +80,7 @@ impl ProcessProgBg { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/progress.rs b/yazi-scheduler/src/progress.rs index a28101ac..d52c4eea 100644 --- a/yazi-scheduler/src/progress.rs +++ b/yazi-scheduler/src/progress.rs @@ -101,24 +101,24 @@ impl TaskProg { } } - pub fn cleaning(self) -> bool { + pub fn cleaned(self) -> bool { match self { // File - Self::FilePaste(p) => p.cleaning(), - Self::FileLink(p) => p.cleaning(), - Self::FileHardlink(p) => p.cleaning(), - Self::FileDelete(p) => p.cleaning(), - Self::FileTrash(p) => p.cleaning(), + Self::FilePaste(p) => p.cleaned(), + Self::FileLink(p) => p.cleaned(), + Self::FileHardlink(p) => p.cleaned(), + Self::FileDelete(p) => p.cleaned(), + Self::FileTrash(p) => p.cleaned(), // Plugin - Self::PluginEntry(p) => p.cleaning(), + Self::PluginEntry(p) => p.cleaned(), // Prework - Self::PreworkFetch(p) => p.cleaning(), - Self::PreworkLoad(p) => p.cleaning(), - Self::PreworkSize(p) => p.cleaning(), + Self::PreworkFetch(p) => p.cleaned(), + Self::PreworkLoad(p) => p.cleaned(), + Self::PreworkSize(p) => p.cleaned(), // Process - Self::ProcessBlock(p) => p.cleaning(), - Self::ProcessOrphan(p) => p.cleaning(), - Self::ProcessBg(p) => p.cleaning(), + Self::ProcessBlock(p) => p.cleaned(), + Self::ProcessOrphan(p) => p.cleaned(), + Self::ProcessBg(p) => p.cleaned(), } } diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 790801e4..55dc0f26 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -390,7 +390,7 @@ impl Scheduler { let Some(task) = ongoing.get_mut(op.id) else { continue }; op.out.reduce(task); - if !task.prog.success() { + if !task.prog.success() && !task.prog.cleaned() { continue; } else if let Some(hook) = ongoing.hooks.pop(op.id) && let Some(fut) = hook.call(false)