A Claude Code hook formats each .rs file as it is edited, and the pre-commit hook runs clippy as well as the format check. Clippy only checks, so with the line-tables profile it takes under a minute (57 s after a change) at load 8. rust-analyzer, which gave the same errors as clippy for 2.8 GB of memory, is no longer used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
473 B
JSON
23 lines
473 B
JSON
{
|
|
"permissions": {
|
|
"allow": [
|
|
"Bash(ffprobe -v error *)",
|
|
"Bash(env)",
|
|
"mcp__outline__read_document"
|
|
]
|
|
},
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Edit|Write|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.rs) rustfmt --edition 2024 \"$f\" 2>/dev/null || true;; esac"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|