mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
Add PostToolUse hook for automatic ruff formatting (#158)
Configure automatic formatting via ruff check --fix and ruff format after Edit/Write/MultiEdit operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9377faa943
commit
d3190f12d3
1 changed files with 25 additions and 0 deletions
25
.claude/settings.json
Normal file
25
.claude/settings.json
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(python -m ruff check src/ tests/ --fix)",
|
||||
"Bash(python -m ruff format src/ tests/)",
|
||||
"Bash(python -m mypy src/)",
|
||||
"Bash(python -m pytest tests/)",
|
||||
"Bash(python -m pytest tests/*)"
|
||||
],
|
||||
"deny": []
|
||||
},
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "python -m ruff check src/ tests/ --fix && python -m ruff format src/ tests/"
|
||||
}
|
||||
],
|
||||
"matcher": "Edit|Write|MultiEdit"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue