Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -30,6 +30,10 @@ def main():
if not file_path:
sys.exit(0)

# Only check files in src/ directory
if not file_path.startswith("src/") and "/src/" not in file_path:
sys.exit(0)

# Convert to Path object for easier handling
path = Path(file_path)

Expand Down
5 changes: 5 additions & 0 deletions .claude/hooks/graphql-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
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 f.startswith("src/") or "/src/" in f]
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")
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