Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/hooks/check-as-any-pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def main():
# Convert to Path object for easier handling
path = Path(file_path)

# Only check files in src/ directory
if not path.parts or path.parts[0] != "src":
sys.exit(0)

# Check if it's a TypeScript file
if path.suffix not in [".ts", ".tsx"]:
sys.exit(0)
Expand Down
8 changes: 7 additions & 1 deletion .claude/hooks/graphql-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import sys
import os
from pathlib import Path

try:
data = json.load(sys.stdin)
Expand All @@ -29,10 +30,15 @@
if file_path:
files_to_check.append(file_path)

# Only proceed if files are in src/ directory
src_files = [f for f in files_to_check if Path(f).parts and Path(f).parts[0] == "src"]
if not src_files:
sys.exit(0)

# Check if any of the files are GraphQL query/mutation files
graphql_files_modified = any(
file_path.endswith("mutations.ts") or file_path.endswith("queries.ts")
for file_path in files_to_check
for file_path in src_files
)

if graphql_files_modified:
Expand Down
8 changes: 7 additions & 1 deletion .claude/hooks/validation-check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# Check if there are any changes in src/ directory
if ! git diff --name-only HEAD | grep -q '^src/'; then
echo 'ℹ️ No changes in src/ directory, skipping validation' >&2
exit 0
fi

echo '🔍 Running final validation...' >&2

# Run type checking
Expand All @@ -10,7 +16,7 @@ fi

# Run linting
if ! npm run lint; then
echo '❌ ESLint validation failed - please fix linting errors before completing the task' >&2
echo '❌ ESLint validation failed - please fix linting errors before completing the task' >&2
exit 2
fi

Expand Down
Loading