diff --git a/.claude/hooks/post-edit-format.sh b/.claude/hooks/post-edit-format.sh index dc8b97d5..39f5f4a5 100755 --- a/.claude/hooks/post-edit-format.sh +++ b/.claude/hooks/post-edit-format.sh @@ -1,23 +1,22 @@ #!/bin/bash -# Post-edit hook: apply license headers and format with deno fmt -# Runs after Edit or Write tool use to ensure consistent formatting +# Post-edit hook: auto-fix license headers, formatting, and linting +# Runs after Edit or Write tool use — only does auto-fixable operations set -euo pipefail INPUT=$(cat) FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty') -# Format TypeScript/TSX files and apply license headers +# Auto-fix TypeScript/TSX files if [[ "$FILE_PATH" == *.ts || "$FILE_PATH" == *.tsx ]]; then cd "$CLAUDE_PROJECT_DIR" - deno run license-headers 2>/dev/null - deno fmt "$FILE_PATH" 2>/dev/null - deno lint "$FILE_PATH" 2>/dev/null - deno check "$FILE_PATH" 2>/dev/null + deno run license-headers + deno fmt "$FILE_PATH" + deno lint --fix "$FILE_PATH" # Format Markdown files elif [[ "$FILE_PATH" == *.md ]]; then cd "$CLAUDE_PROJECT_DIR" - deno fmt "$FILE_PATH" 2>/dev/null + deno fmt "$FILE_PATH" fi exit 0 diff --git a/.claude/hooks/stop-verify.sh b/.claude/hooks/stop-verify.sh index a7dc9b67..0133f75e 100755 --- a/.claude/hooks/stop-verify.sh +++ b/.claude/hooks/stop-verify.sh @@ -8,7 +8,7 @@ cd "$CLAUDE_PROJECT_DIR" ERRORS="" -if ! deno check 2>&1; then +if ! deno task check 2>&1; then ERRORS="${ERRORS}deno check failed\n" fi @@ -16,8 +16,8 @@ if ! deno lint 2>&1; then ERRORS="${ERRORS}deno lint failed\n" fi -if ! deno run test 2>&1; then - ERRORS="${ERRORS}deno run test failed\n" +if ! deno task test 2>&1; then + ERRORS="${ERRORS}deno test failed\n" fi if [ -n "$ERRORS" ]; then diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e192fe44..e54ba8f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,14 @@ jobs: - name: Run deno fmt --check run: deno fmt --check + - name: Run deno check + run: deno task check + - name: Run deno test - run: deno test --unstable-bundle --allow-read --allow-write --allow-env --allow-run --allow-net --allow-sys + run: deno task test - name: Compile binary - run: deno run compile + run: deno task compile deps-audit: name: Dependency Audit diff --git a/CLAUDE.md b/CLAUDE.md index fb6c24b5..5147c746 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,8 +27,8 @@ When creating or updating `swamp-*` skills in `.claude/skills/`, follow the Changes should only touch what's necessary — don't refactor adjacent code that isn't part of the task. Keep the blast radius small. -Post-edit hooks in `.claude/hooks/` automatically enforce license headers, -`deno fmt`, `deno lint`, and `deno check` on each changed file. +Post-edit hooks in `.claude/hooks/` automatically run license headers, +`deno fmt`, and `deno lint --fix` on each changed file. ## Commands @@ -57,8 +57,8 @@ Use `deno run` to get a complete list of custom tasks. ## Verification -Post-edit hooks in `.claude/hooks/` automatically enforce license headers, -`deno fmt`, `deno lint`, and `deno check` on each changed file. A Stop hook in +Post-edit hooks in `.claude/hooks/` automatically run license headers, +`deno fmt`, and `deno lint --fix` on each changed file. A Stop hook in `.claude/hooks/stop-verify.sh` runs project-wide `deno check`, `deno lint`, and `deno run test` before completion — blocking until all pass. After completing all work, run `deno run compile` to recompile the binary.