# Rust Lint Fmt

> Run cargo clippy and nightly rustfmt to lint and format Rust code. Use when the user asks to lint, format, check code quality, or run CI checks on Rust code. Use when this capability is needed.

- Skill: `tomevault-io/rust-lint-fmt` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rust-lint-fmt`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rust-lint-fmt/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rust-lint-fmt

---


# Rust Lint & Format

## Clippy

Run clippy including test code:

```bash
cargo clippy --tests
```

### Fixing clippy warnings

- **Actually resolve** each warning by fixing the underlying code.
- **Never** suppress warnings with `#[allow(...)]`, `#[expect(...)]`, or `#![allow(...)]` attributes unless the user explicitly asks for it.
- If a warning seems like a false positive, ask the user before suppressing it.

## Rustfmt

Run nightly rustfmt to check which files need formatting:

```bash
cargo +nightly fmt -- -l --config imports_granularity=Module,group_imports=StdExternalCrate,reorder_imports=true
```

If files are listed in the output, format them by running:

```bash
cargo +nightly fmt -- --config imports_granularity=Module,group_imports=StdExternalCrate,reorder_imports=true
```

## Workflow

1. Run clippy. Fix all warnings (do not suppress with allow attributes). Re-run clippy until clean.
2. Run rustfmt in list mode. If files are listed, run rustfmt to apply formatting. Verify no files remain.

---
> Source: [conradludgate/filament](https://github.com/conradludgate/filament) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-28 -->

