fix(git-hook): correct project root path and exclude .git directories from forbidden check

- Update cd path from "../.." to properly navigate to project root from scripts directory
- Add .git directory exclusion pattern to prevent false positives on git metadata
- Remove test_bad_location.py placeholder file
This commit is contained in:
oib
2026-03-02 15:50:43 +01:00
parent d6958abdea
commit 3b3e93770e
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
echo "🔍 Checking file locations before commit..."
# Change to project root
cd "$(dirname "$0")/.."
cd "$(dirname "$0")/../.."
# Files that should not be at root
ROOT_FORBIDDEN_PATTERNS=(
@@ -54,7 +54,7 @@ done
# Check for forbidden directories at root
for dir in "${ROOT_FORBIDDEN_DIRS[@]}"; do
if [[ -d "$dir" && "$dir" != "." && "$dir" != ".." ]]; then
if [[ -d "$dir" && "$dir" != "." && "$dir" != ".." && ! "$dir" =~ ^\.git ]]; then
echo "❌ ERROR: Found directory '$dir' at root level"
echo "📁 Suggested location:"