store: Cargo check post-edit hook for Rust files in Claude Code
This commit is contained in:
parent
0f38537f41
commit
04670a5168
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
id: a2d02aea-07fd-4528-8158-f2f42a23a2dd
|
||||||
|
type: configuration
|
||||||
|
title: "Cargo check post-edit hook for Rust files in Claude Code"
|
||||||
|
tags: [sba-scouting, rust, claude-code, hooks, linting, cargo, configuration, developer-experience]
|
||||||
|
importance: 0.65
|
||||||
|
confidence: 0.8
|
||||||
|
created: "2026-03-02T00:33:26.804471+00:00"
|
||||||
|
updated: "2026-03-02T00:33:26.804471+00:00"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Cargo Check Post-Edit Hook Configuration
|
||||||
|
|
||||||
|
## File
|
||||||
|
`rust/.claude/settings.json`
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Runs `cargo check --message-format=short` automatically after any Edit or Write to `.rs` files during a Claude Code session. Provides fast feedback without waiting for a manual build.
|
||||||
|
|
||||||
|
## Why cargo check (not clippy)
|
||||||
|
- `cargo clippy` is too slow for every single edit (takes several seconds)
|
||||||
|
- `cargo check` is faster — catches type errors and borrow checker issues quickly
|
||||||
|
- Clippy should be run manually at logical checkpoints:
|
||||||
|
- Before commits
|
||||||
|
- After finishing a feature
|
||||||
|
- After batch edits to multiple files
|
||||||
|
|
||||||
|
## Settings JSON Structure
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"PostToolUse": [
|
||||||
|
{
|
||||||
|
"matcher": { "tool_name": ["Edit", "Write"], "file_paths": [".*\\.rs$"] },
|
||||||
|
"hooks": [
|
||||||
|
{ "type": "command", "command": "cargo check --message-format=short" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
Also documented in `rust/CLAUDE.md` for future session context.
|
||||||
Loading…
Reference in New Issue
Block a user