feat: add rustfmt configuration and CI workflow for code formatting

refactor: streamline formatting workflow by removing unused taplo steps and clarifying directory change

refactor: remove unnecessary directory change step in formatting workflow
This commit is contained in:
Tunglies
2025-06-06 21:11:14 +08:00
parent 689042df60
commit 09969d95de
89 changed files with 2630 additions and 2008 deletions

View File

@@ -82,21 +82,21 @@ export const BackupConfigViewer = memo(
if (!url) {
urlRef.current?.focus();
showNotice('error', t("WebDAV URL Required"));
showNotice("error", t("WebDAV URL Required"));
throw new Error(t("WebDAV URL Required"));
} else if (!isValidUrl(url)) {
urlRef.current?.focus();
showNotice('error', t("Invalid WebDAV URL"));
showNotice("error", t("Invalid WebDAV URL"));
throw new Error(t("Invalid WebDAV URL"));
}
if (!username) {
usernameRef.current?.focus();
showNotice('error', t("WebDAV URL Required"));
showNotice("error", t("WebDAV URL Required"));
throw new Error(t("Username Required"));
}
if (!password) {
passwordRef.current?.focus();
showNotice('error', t("WebDAV URL Required"));
showNotice("error", t("WebDAV URL Required"));
throw new Error(t("Password Required"));
}
};
@@ -110,11 +110,11 @@ export const BackupConfigViewer = memo(
data.username.trim(),
data.password,
).then(() => {
showNotice('success', t("WebDAV Config Saved"));
showNotice("success", t("WebDAV Config Saved"));
onSaveSuccess();
});
} catch (error) {
showNotice('error', t("WebDAV Config Save Failed", { error }), 3000);
showNotice("error", t("WebDAV Config Save Failed", { error }), 3000);
} finally {
setLoading(false);
}
@@ -125,11 +125,11 @@ export const BackupConfigViewer = memo(
try {
setLoading(true);
await createWebdavBackup().then(async () => {
showNotice('success', t("Backup Created"));
showNotice("success", t("Backup Created"));
await onBackupSuccess();
});
} catch (error) {
showNotice('error', t("Backup Failed", { error }));
showNotice("error", t("Backup Failed", { error }));
} finally {
setLoading(false);
}