chore(ci): align lint gate and add strict audit path (#410)

This commit is contained in:
Chummy 2026-02-17 01:36:17 +08:00 committed by GitHub
parent 74c0c7340b
commit b161fff9ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 10 deletions

View file

@ -18,8 +18,12 @@ cargo build
# Run tests (all must pass)
cargo test
# Format & lint (must pass before PR)
cargo fmt && cargo clippy -- -D warnings
# Format & lint (required before PR)
cargo fmt --all -- --check
cargo clippy --all-targets -- -D clippy::correctness
# Optional strict lint audit (recommended periodically)
cargo clippy --all-targets -- -D warnings
# Release build (~3.4MB)
cargo build --release
@ -27,7 +31,19 @@ cargo build --release
### Pre-push hook
The repo includes a pre-push hook in `.githooks/` that enforces `cargo fmt --check`, `cargo clippy -- -D warnings`, and `cargo test` before every push. Enable it with `git config core.hooksPath .githooks`.
The repo includes a pre-push hook in `.githooks/` that enforces `cargo fmt --all -- --check`, `cargo clippy --all-targets -- -D clippy::correctness`, and `cargo test` before every push. Enable it with `git config core.hooksPath .githooks`.
For an opt-in strict lint pass during pre-push, set:
```bash
ZEROCLAW_STRICT_LINT=1 git push
```
For full CI parity in Docker, run:
```bash
./dev/ci.sh all
```
To skip it during rapid iteration:
@ -325,8 +341,9 @@ impl Tool for YourTool {
- [ ] PR template sections are completed (including security + rollback)
- [ ] `cargo fmt --all -- --check` — code is formatted
- [ ] `cargo clippy --all-targets -- -D warnings` — no warnings
- [ ] `cargo clippy --all-targets -- -D clippy::correctness` — merge gate lint baseline passes
- [ ] `cargo test` — all tests pass locally or skipped tests are explained
- [ ] Optional strict audit: `cargo clippy --all-targets -- -D warnings` (run when doing lint cleanup or before release-hardening work)
- [ ] New code has inline `#[cfg(test)]` tests
- [ ] No new dependencies unless absolutely necessary (we optimize for binary size)
- [ ] README updated if adding user-facing features