Format Python Files

Claude Code Hook · post-tool

format-python-files एक Claude Code hook है जो हर बार Python फ़ाइल edit होने पर black formatter चलाकर कोड को स्वचालित रूप से फॉर्मेट करता है। Python developers के लिए कोड स्टाइल को लगातार बनाए रखने में मदद करता है।

Automatically format Python files after any Edit operation using black formatter. This hook runs 'black' on any .py file that Claude modifies, ensuring consistent Python code formatting. Requires black to be installed ('pip install black'). The command includes error suppression (2>/dev/null || true) so it won't fail if black is not installed.

Install

npx claude-code-templates@latest --hook post-tool/format-python-files

View on GitHub