antrophiclove
← Kütüphaneye dön
Kurulum
curl -sL https://www.antrophiclove.com/api/kaynak/format-python-files/raw

Bu içerik mevcut dosyaya elle harmanlanmalı: .claude/settings.json

format-python-files

Automatically format Python files after any Edit operation using black formatter

Event Configuration

  • Event Type: PostToolUse
  • Tool Matcher: Edit
  • Category: formatting

Environment Variables

None required

Requirements

  • black (pip install black)

Script

file_path=$(jq -r '.tool_input.file_path // empty')
if [[ "$file_path" =~ \.py$ ]]; then
  python3 -m black "$file_path" 2>/dev/null || true
fi