| name | zihuan-lint |
| description | Lint and format zihuan-next code. Use this skill when asked to check for warnings, run clippy, format code, or fix lint issues. |
Linting and Formatting zihuan-next
The project uses Clippy for linting and rustfmt for formatting. There are no custom clippy.toml or rustfmt.toml configuration files — Rust's default settings apply.
Quick checks
cargo clippy --all-targets --all-features
cargo clippy -p zihuan_service --all-targets
cargo fmt --all -- --check
cargo fmt --all
Fixing issues
cargo clippy --all-targets --all-features --fix --allow-dirty
cargo fmt --all
Frontend linting
For TypeScript/JavaScript in webui/:
cd webui
pnpm run lint
Common clippy categories
| Lint group | What it catches |
|---|
clippy::all | Default warn-by-default lints |
clippy::pedantic | Stricter style lints (not enabled by default) |
clippy::nursery | New lints still under development |
clippy::cargo | Cargo.toml-specific lints |
Agent tips
- Run clippy before every commit —
cargo clippy --all-targets --all-features catches most issues early.
- Fix warnings, not just errors — warnings often indicate real bugs or style drift.
- Run
cargo fmt --all after making changes — ensures consistent formatting across the workspace.
- Clippy may produce false positives — use
#[allow(clippy::lint_name)] sparingly at the smallest scope possible (function or block, not module).
- No custom config files exist — if you need to adjust lint or format rules, add a
[lints] section to the workspace Cargo.toml or create clippy.toml / rustfmt.toml at the workspace root.