Skip to content

armgit / Wake

Public Imported from GitHub
0

All your AI agent sessions in one place — browse, search, resume. Rust + GPUI.

Rust

ci: check formatting in CI and the pre-commit hook

Corey Chiuce2851abbe88
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f514030..8617361 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,6 +21,12 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
+ with:
+ components: rustfmt
+
+ # 格式门槛:rustfmt 漂移一次就红,不让它累积(2026-09-14 归零后加)
+ - name: Check formatting
+ run: cargo fmt --all --check
- name: Install Intel macOS target
if: runner.os == 'macOS'
diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit
index 950488b..a0fb278 100755
--- a/scripts/hooks/pre-commit
+++ b/scripts/hooks/pre-commit
@@ -1,8 +1,11 @@
#!/bin/zsh
-# 提交前门槛:数据层测试 + 全仓编译检查。
+# 提交前门槛:格式检查 + 数据层测试 + 全仓编译检查。
# 启用(一次):git config core.hooksPath scripts/hooks
set -e
+echo "pre-commit: cargo fmt --check"
+cargo fmt --all --check
+
echo "pre-commit: cargo test -p wake-core"
cargo test -p wake-core --quiet