ci: enable Dependabot

This commit is contained in:
sxyazi 2025-09-06 23:31:38 +08:00
parent 021d86f0d1
commit d2d7d570d9
No known key found for this signature in database
10 changed files with 43 additions and 29 deletions

15
.github/dependabot.yml vendored Normal file
View file

@ -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"

View file

@ -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()));
}
}

View file

@ -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};

View file

@ -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))

View file

@ -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<f32> {
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<f32> { 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<f32> { 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<f32> {
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<f32> { None }
}

View file

@ -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<f32> { None }
}

View file

@ -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<f32> { 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<f32> { 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<f32> { None }
}

View file

@ -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<f32> { 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<f32> { 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<f32> { None }
}

View file

@ -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(),
}
}

View file

@ -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)