From bdc9f0f7111cc4e290f92e17ec7224490199f7fa Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 15 Jul 2026 17:50:00 +0800 Subject: [PATCH] =?UTF-8?q?chore(make):=20fix=20=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20cargo=20fmt=20=E4=B8=8E=20dx=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 自动修复流程此前只跑 biome format + cargo fix,缺少格式化收尾: cargo fix 应用编译器建议会重写代码,dx fmt 会改写 rsx!, 两者都可能留下不符合 rustfmt 风格的输出。 现在按 Biome → cargo fix → cargo fmt → dx fmt 顺序执行, 两道格式化收尾保证最终文件状态整洁。 --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e6fe63..4513174 100644 --- a/Makefile +++ b/Makefile @@ -120,11 +120,17 @@ lint: @cargo clippy --all-targets --all-features -- -D warnings # JS + Rust 自动修复(直接写入文件)。 +# 顺序:Biome → cargo fix(应用编译器建议,重写代码)→ cargo fmt(格式化 Rust) +# → dx fmt(格式化 RSX 宏)。两道格式化收尾,保证最终文件状态整洁。 fix: @echo "==> Biome format (libs, 写入文件)" @cd libs && pnpm exec biome format --write . - @echo "==> Cargo fix (Rust)" + @echo "==> Cargo fix (Rust, 应用编译器建议)" @cargo fix --allow-dirty + @echo "==> Cargo fmt (Rust, 格式化)" + @cargo fmt + @echo "==> Dioxus fmt (RSX 宏, 格式化)" + @dx fmt # 只编译当前 crate 的文档(--no-deps 跳过依赖,--document-private-items # 让纯 binary crate 的内部模块/私有项也进文档,否则页面基本是空的)。