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:
@@ -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:"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user