mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 23:36:20 +00:00
chore: bootstrap Claude setup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
7f5c7738e5
13 files changed
+211
No files matched your search
@@ -0,0 +1 @@
|
||||
2
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# PostToolUse (Edit/Write): format the changed file. Never blocks.
|
||||
f=$(jq -r '.tool_input.file_path // empty' 2>/dev/null)
|
||||
[ -n "$f" ] && [ -f "$f" ] || exit 0
|
||||
case "$f" in
|
||||
*.rs) command -v rustfmt >/dev/null && rustfmt --edition 2021 -q "$f" 2>/dev/null ;;
|
||||
*.dart) command -v dart >/dev/null && dart format -o write "$f" >/dev/null 2>&1 ;;
|
||||
esac
|
||||
exit 0
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Stop hook: lint + tests must pass before the turn ends (exit 2 blocks).
|
||||
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" || exit 0
|
||||
fail() { echo "$1 failed:" >&2; echo "$2" | tail -40 >&2; exit 2; }
|
||||
if [ -f Cargo.toml ]; then
|
||||
out=$(cargo clippy --workspace --all-targets -q -- -D warnings 2>&1) || fail clippy "$out"
|
||||
out=$(cargo test --workspace -q 2>&1) || fail "cargo test" "$out"
|
||||
fi
|
||||
if [ -f app/pubspec.yaml ] && command -v flutter >/dev/null; then
|
||||
out=$(cd app && flutter analyze 2>&1) || fail "flutter analyze" "$out"
|
||||
fi
|
||||
exit 0
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Edit|Write",
|
||||
"hooks": [{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/format.sh" }]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/stop-check.sh", "timeout": 900 }]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user