From d3d32006c38fee97123f935fceaa8c15860a155a Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sat, 1 Nov 2025 21:22:41 +0800 Subject: [PATCH] feat: add logging check to pre-commit and CI workflow --- .github/workflows/lint-clippy.yml | 7 +++++++ .husky/pre-commit | 5 +++++ src-tauri/src/lib.rs | 1 - src-tauri/src/main.rs | 1 - 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-clippy.yml b/.github/workflows/lint-clippy.yml index 30ed828b..d7f3416b 100644 --- a/.github/workflows/lint-clippy.yml +++ b/.github/workflows/lint-clippy.yml @@ -73,3 +73,10 @@ jobs: - name: Run Clippy working-directory: ./src-tauri run: cargo clippy-all + + - name: Run Logging Check + working-directory: ./src-tauri + shell: bash + run: | + cargo install --git https://github.com/clash-verge-rev/clash-verge-logging-check.git + clash-verge-logging-check diff --git a/.husky/pre-commit b/.husky/pre-commit index 77736fde..ee8dc1ce 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -27,6 +27,11 @@ if [ -n "$RUST_FILES" ]; then ( cd src-tauri cargo clippy-all + if ! command -v clash-verge-logging-check >/dev/null 2>&1; then + echo "[pre-commit] Installing clash-verge-logging-check..." + cargo install --git https://github.com/clash-verge-rev/clash-verge-logging-check.git + fi + clash-verge-logging-check ) fi diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index caa7261d..84cb533a 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -30,7 +30,6 @@ use tauri_plugin_deep_link::DeepLinkExt; use utils::logging::Type; pub static APP_HANDLE: OnceCell = OnceCell::new(); - /// Application initialization helper functions mod app_init { use anyhow::Result; diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f69742fc..4f3d6015 100755 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -10,6 +10,5 @@ fn main() { std::env::set_var("CLASH_VERGE_DISABLE_TRAY", "1"); } } - app_lib::run(); }