From d3190f12d3552eea34bf4a3ac4ccf124da146eff Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Mon, 8 Sep 2025 07:06:46 -0700 Subject: [PATCH] Add PostToolUse hook for automatic ruff formatting (#158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .claude/settings.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..33ef122 --- /dev/null +++ b/.claude/settings.json @@ -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" + } + ] + } +} \ No newline at end of file