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
33 changes: 33 additions & 0 deletions .claude/hooks/SessionStart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Session start hook to ensure pre-commit is installed
echo "Setting up pre-commit..."

# Check if pre-commit is available, install if not
if ! command -v pre-commit &> /dev/null; then
echo "pre-commit is not installed. Installing pre-commit..."

# Try to install pre-commit using pip
if command -v pip3 &> /dev/null; then
pip3 install pre-commit
elif command -v pip &> /dev/null; then
pip install pre-commit
else
echo "Error: pip is not installed. Cannot install pre-commit."
exit 1
fi

# Verify installation
if ! command -v pre-commit &> /dev/null; then
echo "Error: Failed to install pre-commit."
exit 1
fi

echo "pre-commit installed successfully!"
fi

# Install pre-commit hooks
pre-commit install
pre-commit install --hook-type commit-msg

echo "Pre-commit hooks installed successfully!"
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ repos:
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
- repo: local
hooks:
- id: php-cs-fixer
name: PHP CS Fixer
entry: vendor/bin/php-cs-fixer fix
language: system
types: [php]
pass_filenames: false
- id: phpunit
name: PHPUnit
entry: vendor/bin/phpunit
language: system
types: [php]
pass_filenames: false