refactor: enforce layered crates and Rust audit gates

This commit is contained in:
Horldsence
2026-09-24 13:00:03 +08:00
parent af151525d1
commit 8a582fc102
67 changed files with 3918 additions and 581 deletions
+21 -3
View File
@@ -11,18 +11,36 @@ lint:
test:
cargo test --workspace --all-targets
audit:
cargo +nightly -Zscript scripts/audit-rules.rs
audit-test:
cargo +nightly -Zscript scripts/audit-rules.rs --self-test
install-hooks:
git config --local core.hooksPath .githooks
chmod +x .githooks/pre-commit
check:
just fmt
just lint
just test
just audit
vcan-test:
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan || true
sudo ip link set up vcan0
cargo test -p socketcan@0.1.0 --test vcan -- --ignored --test-threads 1
cargo test -p integration-tests --test socketcan_vcan -- --ignored --test-threads 1
run-mock:
cargo run -p chassisd -- --mock
rc-monitor device="/dev/ttyS2":
cargo run --release -p spin -- rc --device {{device}}
check-structure:
test -z "$(find crates/*/src -mindepth 2 -type d -print)"
! rg -n '\bunsafe\b|libc|no_std' crates Cargo.toml -g '*.rs' -g '*.toml'
cargo +nightly -Zscript scripts/audit-rules.rs
build-armv7:
rustup target add armv7-unknown-linux-musleabihf